mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
ComboBox: added UI property ComboBox.buttonFocusedEditableBackground (issue #1068)
This commit is contained in:
@@ -3,6 +3,8 @@ FlatLaf Change Log
|
||||
|
||||
## 3.7.1-SNAPSHOT
|
||||
|
||||
- ComboBox: Added UI property `ComboBox.buttonFocusedEditableBackground`. (issue
|
||||
#1068)
|
||||
- Popup: Fixed scrolling popup painting issue on Windows 10 when a glass pane is
|
||||
visible and frame is maximized. (issue #1071)
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ import com.formdev.flatlaf.util.SystemInfo;
|
||||
* @uiDefault ComboBox.buttonBackground Color optional
|
||||
* @uiDefault ComboBox.buttonEditableBackground Color optional
|
||||
* @uiDefault ComboBox.buttonFocusedBackground Color optional; defaults to ComboBox.focusedBackground
|
||||
* @uiDefault ComboBox.buttonFocusedEditableBackground Color optional; defaults to ComboBox.buttonEditableBackground
|
||||
* @uiDefault ComboBox.buttonSeparatorWidth int or float optional; defaults to Component.borderWidth
|
||||
* @uiDefault ComboBox.buttonSeparatorColor Color optional
|
||||
* @uiDefault ComboBox.buttonDisabledSeparatorColor Color optional
|
||||
@@ -147,6 +148,7 @@ public class FlatComboBoxUI
|
||||
@Styleable protected Color buttonBackground;
|
||||
@Styleable protected Color buttonEditableBackground;
|
||||
@Styleable protected Color buttonFocusedBackground;
|
||||
/** @since 3.7.1 */ @Styleable protected Color buttonFocusedEditableBackground;
|
||||
/** @since 2 */ @Styleable protected float buttonSeparatorWidth;
|
||||
/** @since 2 */ @Styleable protected Color buttonSeparatorColor;
|
||||
/** @since 2 */ @Styleable protected Color buttonDisabledSeparatorColor;
|
||||
@@ -258,6 +260,7 @@ public class FlatComboBoxUI
|
||||
|
||||
buttonBackground = UIManager.getColor( "ComboBox.buttonBackground" );
|
||||
buttonFocusedBackground = UIManager.getColor( "ComboBox.buttonFocusedBackground" );
|
||||
buttonFocusedEditableBackground = UIManager.getColor( "ComboBox.buttonFocusedEditableBackground" );
|
||||
buttonEditableBackground = UIManager.getColor( "ComboBox.buttonEditableBackground" );
|
||||
buttonSeparatorWidth = FlatUIUtils.getUIFloat( "ComboBox.buttonSeparatorWidth", FlatUIUtils.getUIFloat( "Component.borderWidth", 1 ) );
|
||||
buttonSeparatorColor = UIManager.getColor( "ComboBox.buttonSeparatorColor" );
|
||||
@@ -293,6 +296,7 @@ public class FlatComboBoxUI
|
||||
buttonBackground = null;
|
||||
buttonEditableBackground = null;
|
||||
buttonFocusedBackground = null;
|
||||
buttonFocusedEditableBackground = null;
|
||||
buttonSeparatorColor = null;
|
||||
buttonDisabledSeparatorColor = null;
|
||||
buttonArrowColor = null;
|
||||
@@ -587,7 +591,7 @@ public class FlatComboBoxUI
|
||||
// paint arrow button background
|
||||
if( enabled && !isCellRenderer && arrowButton.isVisible() ) {
|
||||
Color buttonColor = paintButton
|
||||
? buttonEditableBackground
|
||||
? (buttonFocusedEditableBackground != null && isPermanentFocusOwner( comboBox ) ? buttonFocusedEditableBackground : buttonEditableBackground)
|
||||
: (buttonFocusedBackground != null || focusedBackground != null) && isPermanentFocusOwner( comboBox )
|
||||
? (buttonFocusedBackground != null ? buttonFocusedBackground : focusedBackground)
|
||||
: buttonBackground;
|
||||
|
||||
@@ -199,8 +199,9 @@ public class TestFlatStyleableInfo
|
||||
"disabledForeground", Color.class,
|
||||
|
||||
"buttonBackground", Color.class,
|
||||
"buttonFocusedBackground", Color.class,
|
||||
"buttonEditableBackground", Color.class,
|
||||
"buttonFocusedBackground", Color.class,
|
||||
"buttonFocusedEditableBackground", Color.class,
|
||||
"buttonSeparatorWidth", float.class,
|
||||
"buttonSeparatorColor", Color.class,
|
||||
"buttonDisabledSeparatorColor", Color.class,
|
||||
|
||||
@@ -388,8 +388,9 @@ public class TestFlatStyleableValue
|
||||
testColor( c, ui, "disabledForeground" );
|
||||
|
||||
testColor( c, ui, "buttonBackground" );
|
||||
testColor( c, ui, "buttonFocusedBackground" );
|
||||
testColor( c, ui, "buttonEditableBackground" );
|
||||
testColor( c, ui, "buttonFocusedBackground" );
|
||||
testColor( c, ui, "buttonFocusedEditableBackground" );
|
||||
testFloat( c, ui, "buttonSeparatorWidth" );
|
||||
testColor( c, ui, "buttonSeparatorColor" );
|
||||
testColor( c, ui, "buttonDisabledSeparatorColor" );
|
||||
|
||||
@@ -184,6 +184,7 @@ buttonDisabledArrowColor java.awt.Color
|
||||
buttonDisabledSeparatorColor java.awt.Color
|
||||
buttonEditableBackground java.awt.Color
|
||||
buttonFocusedBackground java.awt.Color
|
||||
buttonFocusedEditableBackground java.awt.Color
|
||||
buttonHoverArrowColor java.awt.Color
|
||||
buttonPressedArrowColor java.awt.Color
|
||||
buttonSeparatorColor java.awt.Color
|
||||
|
||||
@@ -235,6 +235,7 @@ ComboBox.buttonDisabledArrowColor #ababab HSL 0 0 67 javax.swing.plaf.C
|
||||
ComboBox.buttonDisabledSeparatorColor #000088 HSL 240 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
ComboBox.buttonEditableBackground #cccccc HSL 0 0 80 javax.swing.plaf.ColorUIResource [UI]
|
||||
ComboBox.buttonFocusedBackground #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ComboBox.buttonFocusedEditableBackground #ffff44 HSL 60 100 63 javax.swing.plaf.ColorUIResource [UI]
|
||||
ComboBox.buttonHighlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
ComboBox.buttonHoverArrowColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ComboBox.buttonPressedArrowColor #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
|
||||
@@ -182,6 +182,7 @@ ComboBox.buttonEditableBackground = #ccc
|
||||
|
||||
ComboBox.focusedBackground = #ff8
|
||||
ComboBox.buttonFocusedBackground = #ff0
|
||||
ComboBox.buttonFocusedEditableBackground = #ff4
|
||||
ComboBox.popupBackground = #ffc
|
||||
|
||||
|
||||
|
||||
@@ -226,6 +226,7 @@ ComboBox.buttonDisabledArrowColor
|
||||
ComboBox.buttonDisabledSeparatorColor
|
||||
ComboBox.buttonEditableBackground
|
||||
ComboBox.buttonFocusedBackground
|
||||
ComboBox.buttonFocusedEditableBackground
|
||||
ComboBox.buttonHighlight
|
||||
ComboBox.buttonHoverArrowColor
|
||||
ComboBox.buttonPressedArrowColor
|
||||
|
||||
Reference in New Issue
Block a user