From a80790fc8ee991ace44c938140763e226486a9ae Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 6 Nov 2020 17:30:29 +0100 Subject: [PATCH] TabbedPane: - use rounded rectangles for buttons in tab area - "pressed" background for buttons in tab area - fill background of buttons in tab area - use derived colors for hover and pressed - fixed missing arrow in "more tabs" button at larger scaling --- .../icons/FlatTabbedPaneCloseIcon.java | 5 +- .../formdev/flatlaf/ui/FlatArrowButton.java | 71 ++++++++---- .../formdev/flatlaf/ui/FlatTabbedPaneUI.java | 109 +++++++++++++++--- .../formdev/flatlaf/FlatDarkLaf.properties | 9 +- .../com/formdev/flatlaf/FlatLaf.properties | 3 + .../formdev/flatlaf/FlatLightLaf.properties | 9 +- .../uidefaults/FlatDarkLaf_1.8.0_202.txt | 12 +- .../uidefaults/FlatLightLaf_1.8.0_202.txt | 12 +- .../uidefaults/FlatTestLaf_1.8.0_202.txt | 4 + .../flatlaf/testing/FlatTestLaf.properties | 3 + .../flatlaf/themeeditor/FlatLafUIKeys.txt | 4 + 11 files changed, 182 insertions(+), 59 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatTabbedPaneCloseIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatTabbedPaneCloseIcon.java index fa5f5114..39e90587 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatTabbedPaneCloseIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatTabbedPaneCloseIcon.java @@ -68,13 +68,14 @@ public class FlatTabbedPaneCloseIcon // paint background Color bg = FlatButtonUI.buttonStateColor( c, background, null, null, hoverBackground, pressedBackground ); if( bg != null ) { - g.setColor( bg ); + g.setColor( FlatUIUtils.deriveColor( bg, c.getBackground() ) ); g.fillRoundRect( (width - size.width) / 2, (height - size.height) / 2, size.width, size.height, arc, arc ); } // set cross color - g.setColor( FlatButtonUI.buttonStateColor( c, foreground, null, null, hoverForeground, pressedForeground ) ); + Color fg = FlatButtonUI.buttonStateColor( c, foreground, null, null, hoverForeground, pressedForeground ); + g.setColor( FlatUIUtils.deriveColor( fg, c.getForeground() ) ); float mx = width / 2; float my = height / 2; diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java index bafc84f5..4b0e44f2 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java @@ -42,12 +42,13 @@ public class FlatArrowButton { public static final int DEFAULT_ARROW_WIDTH = 8; - private final boolean chevron; - private final Color foreground; - private final Color disabledForeground; - private final Color hoverForeground; - private final Color hoverBackground; - private final Color pressedBackground; + protected final boolean chevron; + protected final Color foreground; + protected final Color disabledForeground; + protected final Color hoverForeground; + protected final Color hoverBackground; + protected final Color pressedForeground; + protected final Color pressedBackground; private int arrowWidth = DEFAULT_ARROW_WIDTH; private int xOffset = 0; @@ -64,6 +65,12 @@ public class FlatArrowButton public FlatArrowButton( int direction, String type, Color foreground, Color disabledForeground, Color hoverForeground, Color hoverBackground, Color pressedBackground ) + { + this( direction, type, foreground, disabledForeground, hoverForeground, hoverBackground, null, pressedBackground ); + } + + public FlatArrowButton( int direction, String type, Color foreground, Color disabledForeground, + Color hoverForeground, Color hoverBackground, Color pressedForeground, Color pressedBackground ) { super( direction, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE ); @@ -72,6 +79,7 @@ public class FlatArrowButton this.disabledForeground = disabledForeground; this.hoverForeground = hoverForeground; this.hoverBackground = hoverBackground; + this.pressedForeground = pressedForeground; this.pressedBackground = pressedBackground; setOpaque( false ); @@ -142,6 +150,10 @@ public class FlatArrowButton return background; } + protected Color deriveForeground( Color foreground ) { + return foreground; + } + @Override public Dimension getPreferredSize() { return scale( super.getPreferredSize() ); @@ -157,24 +169,36 @@ public class FlatArrowButton Graphics2D g2 = (Graphics2D)g; FlatUIUtils.setRenderingHints( g2 ); - int width = getWidth(); - int height = getHeight(); - boolean enabled = isEnabled(); - // paint hover or pressed background - if( enabled ) { + if( isEnabled() ) { Color background = (pressedBackground != null && isPressed()) - ? deriveBackground( pressedBackground ) - : ((hoverBackground != null && isHover()) - ? deriveBackground( hoverBackground ) + ? pressedBackground + : (hoverBackground != null && isHover() + ? hoverBackground : null); if( background != null ) { - g.setColor( background ); - g.fillRect( 0, 0, width, height ); + g.setColor( deriveBackground( background ) ); + paintBackground( g2 ); } } + // paint arrow + g.setColor( deriveForeground( isEnabled() + ? (pressedForeground != null && isPressed() + ? pressedForeground + : (hoverForeground != null && isHover() + ? hoverForeground + : foreground)) + : disabledForeground ) ); + paintArrow( g2 ); + } + + protected void paintBackground( Graphics2D g ) { + g.fillRect( 0, 0, getWidth(), getHeight() ); + } + + protected void paintArrow( Graphics2D g ) { int direction = getDirection(); boolean vert = (direction == NORTH || direction == SOUTH); @@ -193,8 +217,8 @@ public class FlatArrowButton rh++; } - int x = Math.round( (width - rw) / 2f + scale( (float) xOffset ) ); - int y = Math.round( (height - rh) / 2f + scale( (float) yOffset ) ); + int x = Math.round( (getWidth() - rw) / 2f + scale( (float) xOffset ) ); + int y = Math.round( (getHeight() - rh) / 2f + scale( (float) yOffset ) ); // move arrow for round borders Container parent = getParent(); @@ -202,20 +226,17 @@ public class FlatArrowButton x -= scale( parent.getComponentOrientation().isLeftToRight() ? 1 : -1 ); // paint arrow - g.setColor( enabled - ? (isHover() && hoverForeground != null ? hoverForeground : foreground) - : disabledForeground ); g.translate( x, y ); /*debug - debugPaint( g2, vert, rw, rh ); + debugPaint( g, vert, rw, rh ); debug*/ Shape arrowShape = createArrowShape( direction, chevron, w, h ); if( chevron ) { - g2.setStroke( new BasicStroke( scale( 1f ) ) ); - g2.draw( arrowShape ); + g.setStroke( new BasicStroke( scale( 1f ) ) ); + g.draw( arrowShape ); } else { // triangle - g2.fill( arrowShape ); + g.fill( arrowShape ); } g.translate( -x, -y ); } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java index 4be02c94..b9fa0aae 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java @@ -108,7 +108,6 @@ import com.formdev.flatlaf.util.UIScale; * * * - * @uiDefault TabbedPane.arrowType String chevron (default) or triangle * @uiDefault TabbedPane.disabledForeground Color * @uiDefault TabbedPane.selectedBackground Color optional * @uiDefault TabbedPane.selectedForeground Color @@ -133,6 +132,12 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault ScrollPane.smoothScrolling boolean * @uiDefault TabbedPane.closeIcon Icon * + * @uiDefault TabbedPane.arrowType String chevron (default) or triangle + * @uiDefault TabbedPane.buttonInsets Insets + * @uiDefault TabbedPane.buttonArc int + * @uiDefault TabbedPane.buttonHoverBackground Color + * @uiDefault TabbedPane.buttonPressedBackground Color + * * @uiDefault TabbedPane.moreTabsButtonToolTipText String * * @author Karl Tauber @@ -154,6 +159,7 @@ public class FlatTabbedPaneUI private static Set focusForwardTraversalKeys; private static Set focusBackwardTraversalKeys; + protected Color foreground; protected Color disabledForeground; protected Color selectedBackground; protected Color selectedForeground; @@ -181,6 +187,12 @@ public class FlatTabbedPaneUI private String tabWidthModeStr; protected Icon closeIcon; + protected String arrowType; + protected Insets buttonInsets; + protected int buttonArc; + protected Color buttonHoverBackground; + protected Color buttonPressedBackground; + protected String moreTabsButtonToolTipText; protected JViewport tabViewport; @@ -200,6 +212,19 @@ public class FlatTabbedPaneUI return new FlatTabbedPaneUI(); } + @Override + public void installUI( JComponent c ) { + // initialize this defaults here because they are used in constructor + // of FlatTabAreaButton, which is invoked before installDefaults() + arrowType = UIManager.getString( "TabbedPane.arrowType" ); + foreground = UIManager.getColor( "TabbedPane.foreground" ); + disabledForeground = UIManager.getColor( "TabbedPane.disabledForeground" ); + buttonHoverBackground = UIManager.getColor( "TabbedPane.buttonHoverBackground" ); + buttonPressedBackground = UIManager.getColor( "TabbedPane.buttonPressedBackground" ); + + super.installUI( c ); + } + @Override protected void installDefaults() { if( UIManager.getBoolean( "TabbedPane.tabsOverlapBorder" ) ) { @@ -224,7 +249,6 @@ public class FlatTabbedPaneUI } else super.installDefaults(); - disabledForeground = UIManager.getColor( "TabbedPane.disabledForeground" ); selectedBackground = UIManager.getColor( "TabbedPane.selectedBackground" ); selectedForeground = UIManager.getColor( "TabbedPane.selectedForeground" ); underlineColor = UIManager.getColor( "TabbedPane.underlineColor" ); @@ -250,6 +274,9 @@ public class FlatTabbedPaneUI tabWidthModeStr = UIManager.getString( "TabbedPane.tabWidthMode" ); closeIcon = UIManager.getIcon( "TabbedPane.closeIcon" ); + buttonInsets = UIManager.getInsets( "TabbedPane.buttonInsets" ); + buttonArc = UIManager.getInt( "TabbedPane.buttonArc" ); + Locale l = tabPane.getLocale(); moreTabsButtonToolTipText = UIManager.getString( "TabbedPane.moreTabsButtonToolTipText", l ); @@ -279,6 +306,7 @@ public class FlatTabbedPaneUI super.uninstallDefaults(); + foreground = null; disabledForeground = null; selectedBackground = null; selectedForeground = null; @@ -288,9 +316,11 @@ public class FlatTabbedPaneUI focusColor = null; tabSeparatorColor = null; contentAreaColor = null; - closeIcon = null; + buttonHoverBackground = null; + buttonPressedBackground = null; + MigLayoutVisualPadding.uninstall( tabPane ); } @@ -825,13 +855,14 @@ public class FlatTabbedPaneUI { // paint tab background boolean enabled = tabPane.isEnabled(); - g.setColor( enabled && tabPane.isEnabledAt( tabIndex ) && getRolloverTab() == tabIndex + Color background = enabled && tabPane.isEnabledAt( tabIndex ) && getRolloverTab() == tabIndex ? hoverColor : (enabled && isSelected && FlatUIUtils.isPermanentFocusOwner( tabPane ) ? focusColor : (selectedBackground != null && enabled && isSelected ? selectedBackground - : tabPane.getBackgroundAt( tabIndex ))) ); + : tabPane.getBackgroundAt( tabIndex ))); + g.setColor( FlatUIUtils.deriveColor( background, tabPane.getBackground() ) ); g.fillRect( x, y, w, h ); } @@ -852,6 +883,10 @@ public class FlatTabbedPaneUI bm.setRollover( rollover && isRolloverTabClose() ); bm.setPressed( rollover && isPressedTabClose() ); + // copy colors from tabbed pane because close icon uses derives colors + tabCloseButton.setBackground( tabPane.getBackground() ); + tabCloseButton.setForeground( tabPane.getForeground() ); + // paint tab close icon Rectangle tabCloseRect = getTabCloseBounds( tabIndex, x, y, w, h, calcRect ); closeIcon.paintIcon( tabCloseButton, g, tabCloseRect.x, tabCloseRect.y ); @@ -1370,20 +1405,62 @@ public class FlatTabbedPaneUI } } + //---- class FlatTabAreaButton -------------------------------------------- + + protected class FlatTabAreaButton + extends FlatArrowButton + { + public FlatTabAreaButton( int direction ) { + super( direction, arrowType, + FlatTabbedPaneUI.this.foreground, FlatTabbedPaneUI.this.disabledForeground, + null, buttonHoverBackground, null, buttonPressedBackground ); + } + + @Override + protected Color deriveBackground( Color background ) { + return FlatUIUtils.deriveColor( background, tabPane.getBackground() ); + } + + @Override + public void paint( Graphics g ) { + // fill button background + if( tabsOpaque || tabPane.isOpaque() ) { + g.setColor( tabPane.getBackground() ); + g.fillRect( 0, 0, getWidth(), getHeight() ); + } + + super.paint( g ); + } + + @Override + protected void paintBackground( Graphics2D g ) { + // rotate button insets + Insets insets = new Insets( 0, 0, 0, 0 ); + rotateInsets( buttonInsets, insets, tabPane.getTabPlacement() ); + + // use UIScale.scale2() here because this gives smaller insets at 150% and 175% + int top = UIScale.scale2( insets.top ); + int left = UIScale.scale2( insets.left ); + int bottom = UIScale.scale2( insets.bottom ); + int right = UIScale.scale2( insets.right ); + + FlatUIUtils.paintComponentBackground( g, left, top, + getWidth() - left - right, + getHeight() - top - bottom, + 0, scale( buttonArc ) ); + } + } + //---- class FlatMoreTabsButton ------------------------------------------- protected class FlatMoreTabsButton - extends FlatArrowButton + extends FlatTabAreaButton implements ActionListener, PopupMenuListener { private boolean popupVisible; public FlatMoreTabsButton() { - // this method is invoked before installDefaults(), so we can not use color fields here - super( SOUTH, UIManager.getString( "TabbedPane.arrowType" ), - UIManager.getColor( "TabbedPane.foreground" ), - UIManager.getColor( "TabbedPane.disabledForeground" ), null, - UIManager.getColor( "TabbedPane.hoverColor" ) ); + super( SOUTH ); updateDirection(); setToolTipText( moreTabsButtonToolTipText ); @@ -1417,7 +1494,7 @@ public class FlatTabbedPaneUI public void paint( Graphics g ) { // paint arrow button near separator line if( direction == EAST || direction == WEST ) { - int xoffset = (getWidth() / 2) - getHeight(); + int xoffset = Math.max( UIScale.unscale( (getWidth() - getHeight()) / 2 ) - 4, 0 ); setXOffset( (direction == EAST) ? xoffset : -xoffset ); } else setXOffset( 0 ); @@ -1520,17 +1597,13 @@ public class FlatTabbedPaneUI //---- class FlatScrollableTabButton -------------------------------------- protected class FlatScrollableTabButton - extends FlatArrowButton + extends FlatTabAreaButton implements MouseListener { private Timer autoRepeatTimer; protected FlatScrollableTabButton( int direction ) { - // this method is invoked before installDefaults(), so we can not use color fields here - super( direction, UIManager.getString( "TabbedPane.arrowType" ), - UIManager.getColor( "TabbedPane.foreground" ), - UIManager.getColor( "TabbedPane.disabledForeground" ), null, - UIManager.getColor( "TabbedPane.hoverColor" ) ); + super( direction ); addMouseListener( this ); } diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties index 85e6d7c2..93c22262 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -254,15 +254,18 @@ SplitPaneDivider.oneTouchHoverArrowColor=#7A7D81 TabbedPane.underlineColor=#4A88C7 TabbedPane.disabledUnderlineColor=#7a7a7a -TabbedPane.hoverColor=#2e3133 +TabbedPane.hoverColor=darken($TabbedPane.background,5%,derived noAutoInverse) TabbedPane.focusColor=#3d4b5c TabbedPane.contentAreaColor=#646464 +TabbedPane.buttonHoverBackground=darken($TabbedPane.background,5%,derived noAutoInverse) +TabbedPane.buttonPressedBackground=darken($TabbedPane.background,8%,derived noAutoInverse) + TabbedPane.closeBackground=null TabbedPane.closeForeground=@disabledText -TabbedPane.closeHoverBackground=lighten($TabbedPane.hoverColor,10%) +TabbedPane.closeHoverBackground=lighten($TabbedPane.background,5%,derived) TabbedPane.closeHoverForeground=@foreground -TabbedPane.closePressedBackground=lighten($TabbedPane.hoverColor,15%) +TabbedPane.closePressedBackground=lighten($TabbedPane.background,10%,derived) TabbedPane.closePressedForeground=$TabbedPane.closeHoverForeground diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index 73c141d4..22b086a8 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -567,8 +567,11 @@ TabbedPane.tabAreaAlignment=leading TabbedPane.tabAlignment=center # allowed values: preferred, equal or compact TabbedPane.tabWidthMode=preferred + # allowed values: chevron or triangle TabbedPane.arrowType=chevron +TabbedPane.buttonInsets=2,1,2,1 +TabbedPane.buttonArc=$Button.arc TabbedPane.closeIcon=com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon TabbedPane.closeSize=16,16 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties index 9bc0e28c..029a3868 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -266,15 +266,18 @@ SplitPaneDivider.oneTouchHoverArrowColor=#333 TabbedPane.underlineColor=#4083C9 TabbedPane.disabledUnderlineColor=#ababab -TabbedPane.hoverColor=#d9d9d9 +TabbedPane.hoverColor=darken($TabbedPane.background,7%,derived) TabbedPane.focusColor=#dae4ed TabbedPane.contentAreaColor=#bfbfbf +TabbedPane.buttonHoverBackground=darken($TabbedPane.background,7%,derived) +TabbedPane.buttonPressedBackground=darken($TabbedPane.background,10%,derived) + TabbedPane.closeBackground=null TabbedPane.closeForeground=@disabledText -TabbedPane.closeHoverBackground=darken($TabbedPane.hoverColor,10%) +TabbedPane.closeHoverBackground=darken($TabbedPane.background,20%,derived) TabbedPane.closeHoverForeground=@foreground -TabbedPane.closePressedBackground=darken($TabbedPane.hoverColor,15%) +TabbedPane.closePressedBackground=darken($TabbedPane.background,25%,derived) TabbedPane.closePressedForeground=$TabbedPane.closeHoverForeground diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt index 2936ac88..6d1280b7 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -911,15 +911,19 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI TabbedPane.arrowType chevron TabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.buttonArc 6 +TabbedPane.buttonHoverBackground #303234 com.formdev.flatlaf.util.DerivedColor [UI] darken(5%) +TabbedPane.buttonInsets 2,1,2,1 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.buttonPressedBackground #282a2c com.formdev.flatlaf.util.DerivedColor [UI] darken(8%) TabbedPane.closeArc 4 TabbedPane.closeCrossFilledSize 7.5 TabbedPane.closeCrossLineWidth 1.0 TabbedPane.closeCrossPlainSize 7.5 TabbedPane.closeForeground #888888 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.closeHoverBackground #464b4e javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverBackground #484c4e com.formdev.flatlaf.util.DerivedColor [UI] lighten(5% autoInverse) TabbedPane.closeHoverForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon [UI] -TabbedPane.closePressedBackground #52585b javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closePressedBackground #54595c com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) TabbedPane.closePressedForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeSize 16,16 javax.swing.plaf.DimensionUIResource [UI] TabbedPane.contentAreaColor #646464 javax.swing.plaf.ColorUIResource [UI] @@ -935,7 +939,7 @@ TabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false TabbedPane.hiddenTabsNavigation moreTabsButton TabbedPane.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.hoverColor #2e3133 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.hoverColor #303234 com.formdev.flatlaf.util.DerivedColor [UI] darken(5%) TabbedPane.labelShift 1 TabbedPane.light #313131 javax.swing.plaf.ColorUIResource [UI] TabbedPane.selectedLabelShift -1 @@ -1150,7 +1154,7 @@ ToggleButton.selectedForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToggleButton.shadow #646464 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.focusBackground #3d4b5c javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.hoverBackground #2e3133 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.tab.hoverBackground #303234 com.formdev.flatlaf.util.DerivedColor [UI] darken(5%) ToggleButton.tab.underlineColor #4a88c7 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.underlineHeight 2 ToggleButton.textIconGap 4 diff --git a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt index 3b11f74c..de1f6fa0 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -916,15 +916,19 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI TabbedPane.arrowType chevron TabbedPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.buttonArc 6 +TabbedPane.buttonHoverBackground #e0e0e0 com.formdev.flatlaf.util.DerivedColor [UI] darken(7% autoInverse) +TabbedPane.buttonInsets 2,1,2,1 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.buttonPressedBackground #d9d9d9 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) TabbedPane.closeArc 4 TabbedPane.closeCrossFilledSize 7.5 TabbedPane.closeCrossLineWidth 1.0 TabbedPane.closeCrossPlainSize 7.5 TabbedPane.closeForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -TabbedPane.closeHoverBackground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverBackground #bfbfbf com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) TabbedPane.closeHoverForeground #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon [UI] -TabbedPane.closePressedBackground #b3b3b3 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closePressedBackground #b2b2b2 com.formdev.flatlaf.util.DerivedColor [UI] darken(25% autoInverse) TabbedPane.closePressedForeground #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeSize 16,16 javax.swing.plaf.DimensionUIResource [UI] TabbedPane.contentAreaColor #bfbfbf javax.swing.plaf.ColorUIResource [UI] @@ -940,7 +944,7 @@ TabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false TabbedPane.hiddenTabsNavigation moreTabsButton TabbedPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -TabbedPane.hoverColor #d9d9d9 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.hoverColor #e0e0e0 com.formdev.flatlaf.util.DerivedColor [UI] darken(7% autoInverse) TabbedPane.labelShift 1 TabbedPane.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] TabbedPane.selectedLabelShift -1 @@ -1155,7 +1159,7 @@ ToggleButton.selectedForeground #000000 javax.swing.plaf.ColorUIResource [UI] ToggleButton.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.disabledUnderlineColor #ababab javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.focusBackground #dae4ed javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.hoverBackground #d9d9d9 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.tab.hoverBackground #e0e0e0 com.formdev.flatlaf.util.DerivedColor [UI] darken(7% autoInverse) ToggleButton.tab.underlineColor #4083c9 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.underlineHeight 2 ToggleButton.textIconGap 4 diff --git a/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt index 25cb6630..53e50cd2 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt @@ -904,6 +904,10 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI TabbedPane.arrowType chevron TabbedPane.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +TabbedPane.buttonArc 6 +TabbedPane.buttonHoverBackground #ffff00 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.buttonInsets 2,1,2,1 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.buttonPressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeArc 999 TabbedPane.closeCrossFilledSize 6.5 TabbedPane.closeCrossLineWidth 2.0 diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties index 109fb330..b4e350ba 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties @@ -284,6 +284,9 @@ TabbedPane.focusColor=#ddd TabbedPane.tabSeparatorColor=#00f TabbedPane.contentAreaColor=#f00 +TabbedPane.buttonHoverBackground=#ff0 +TabbedPane.buttonPressedBackground=#FFC800 + TabbedPane.closeSize=16,16 TabbedPane.closeArc=999 TabbedPane.closeCrossPlainSize={float}12 diff --git a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt index cd9c143d..05b692ab 100644 --- a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt +++ b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt @@ -640,6 +640,10 @@ SplitPaneUI TabbedPane.ancestorInputMap TabbedPane.arrowType TabbedPane.background +TabbedPane.buttonArc +TabbedPane.buttonHoverBackground +TabbedPane.buttonInsets +TabbedPane.buttonPressedBackground TabbedPane.closeArc TabbedPane.closeCrossFilledSize TabbedPane.closeCrossLineWidth