From 2323dc099f0ce109cd0ca7c7a9aefcfc6eca7e14 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 5 Nov 2020 18:59:28 +0100 Subject: [PATCH] TabbedPane: always use chevron arrows (even in IntelliJ and Darcula themes) --- .../main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java | 6 +++--- .../main/resources/com/formdev/flatlaf/FlatLaf.properties | 3 +++ flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt | 1 + flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt | 1 + flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt | 1 + .../com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt | 1 + 6 files changed, 10 insertions(+), 3 deletions(-) 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 c0b32dfa..4be02c94 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,7 @@ import com.formdev.flatlaf.util.UIScale; * * * - * @uiDefault Component.arrowType String triangle (default) or chevron + * @uiDefault TabbedPane.arrowType String chevron (default) or triangle * @uiDefault TabbedPane.disabledForeground Color * @uiDefault TabbedPane.selectedBackground Color optional * @uiDefault TabbedPane.selectedForeground Color @@ -1380,7 +1380,7 @@ public class FlatTabbedPaneUI public FlatMoreTabsButton() { // this method is invoked before installDefaults(), so we can not use color fields here - super( SOUTH, UIManager.getString( "Component.arrowType" ), + super( SOUTH, UIManager.getString( "TabbedPane.arrowType" ), UIManager.getColor( "TabbedPane.foreground" ), UIManager.getColor( "TabbedPane.disabledForeground" ), null, UIManager.getColor( "TabbedPane.hoverColor" ) ); @@ -1527,7 +1527,7 @@ public class FlatTabbedPaneUI protected FlatScrollableTabButton( int direction ) { // this method is invoked before installDefaults(), so we can not use color fields here - super( direction, UIManager.getString( "Component.arrowType" ), + super( direction, UIManager.getString( "TabbedPane.arrowType" ), UIManager.getColor( "TabbedPane.foreground" ), UIManager.getColor( "TabbedPane.disabledForeground" ), null, UIManager.getColor( "TabbedPane.hoverColor" ) ); 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 7d06af7e..50a67736 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -211,6 +211,7 @@ Component.innerFocusWidth={float}0.5 Component.innerOutlineWidth={float}1 Component.arc=5 Component.minimumWidth=64 +# allowed values: chevron or triangle Component.arrowType=chevron Component.hideMnemonics=true @@ -559,6 +560,8 @@ TabbedPane.contentBorderInsets=null TabbedPane.hiddenTabsNavigation=moreTabsButton TabbedPane.tabAreaAlignment=leading TabbedPane.tabAlignment=center +# allowed values: chevron or triangle +TabbedPane.arrowType=chevron TabbedPane.closeIcon=com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon TabbedPane.closeSize=16,16 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 4ec2da97..d3419cea 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -909,6 +909,7 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI #---- TabbedPane ---- +TabbedPane.arrowType chevron TabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeArc 4 TabbedPane.closeCrossFilledSize 7.5 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 a25e5398..31e7697e 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -914,6 +914,7 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI #---- TabbedPane ---- +TabbedPane.arrowType chevron TabbedPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeArc 4 TabbedPane.closeCrossFilledSize 7.5 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 096d82d5..77052cba 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt @@ -902,6 +902,7 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI #---- TabbedPane ---- +TabbedPane.arrowType chevron TabbedPane.background #ccffcc javax.swing.plaf.ColorUIResource [UI] TabbedPane.closeArc 999 TabbedPane.closeCrossFilledSize 6.5 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 ff55cfe2..082cb3d4 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 @@ -638,6 +638,7 @@ SplitPaneDivider.oneTouchHoverArrowColor SplitPaneDivider.style SplitPaneUI TabbedPane.ancestorInputMap +TabbedPane.arrowType TabbedPane.background TabbedPane.closeArc TabbedPane.closeCrossFilledSize