mbien commented on code in PR #4335:
URL: https://github.com/apache/netbeans/pull/4335#discussion_r915957675
##########
platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatViewTabDisplayerUI.java:
##########
@@ -207,40 +220,51 @@ protected void paintTabBackground(Graphics g, int index,
int x, int y, int width
}
private void paintTabBackgroundAtScale1x(Graphics2D g, int index, int
width, int height, double scale) {
- // do not round tab separator width to get nice small lines at 125%,
150% and 175%
- int tabSeparatorWidth = (showTabSeparators && index >= 0) ? (int) (1 *
scale) : 0;
+ boolean selected = isSelected(index);
- // paint background
Color bg = colorForState(index, background, activeBackground,
selectedBackground,
- hoverBackground, attentionBackground);
+ selectedHoverBackground, hoverBackground, attentionBackground);
+
+ boolean showSeparator = showTabSeparators &&
+ // Show separators _between_ tabs (not after the last one),
like for editor tabs.
+ index >= 0 && index < getDataModel().size() - 1 &&
+ /* Don't show separators around the selected tab, if there's
already a border or
+ color contrast at its sides. */
+ (!showSelectedTabBorder &&
selectedBackground.equals(activeBackground) ||
+ (!selected && !isSelected(index + 1)));
Review Comment:
thanks for documenting this.
In case this would get longer in future this could make use of some self
documenting utility methods:
```
boolean showSeparator = showTabSeparators && isNotLast(index) &&
hasLowContrastWithNeighbor(index);
```
But this is fine too IMO.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists