ComboBox, Spinner and SplitPaneDivider: support "pressed" feedback on arrow buttons

This commit is contained in:
Karl Tauber
2020-12-23 00:02:58 +01:00
parent 073a25f381
commit cbb11ebb03
16 changed files with 119 additions and 80 deletions

View File

@@ -70,6 +70,7 @@ public class FlatDatePickerUI
protected Color buttonArrowColor;
protected Color buttonDisabledArrowColor;
protected Color buttonHoverArrowColor;
protected Color buttonPressedArrowColor;
private JButton popupButton;
@@ -94,6 +95,7 @@ public class FlatDatePickerUI
buttonArrowColor = UIManager.getColor( "ComboBox.buttonArrowColor" );
buttonDisabledArrowColor = UIManager.getColor( "ComboBox.buttonDisabledArrowColor" );
buttonHoverArrowColor = UIManager.getColor( "ComboBox.buttonHoverArrowColor" );
buttonPressedArrowColor = UIManager.getColor( "ComboBox.buttonPressedArrowColor" );
super.installUI( c );
@@ -140,6 +142,7 @@ public class FlatDatePickerUI
buttonArrowColor = null;
buttonDisabledArrowColor = null;
buttonHoverArrowColor = null;
buttonPressedArrowColor = null;
if( datePicker.getBorder() instanceof UIResource )
datePicker.setBorder( null );
@@ -160,7 +163,7 @@ public class FlatDatePickerUI
@Override
protected JButton createPopupButton() {
popupButton = new FlatArrowButton( SwingConstants.SOUTH, arrowType, buttonArrowColor,
buttonDisabledArrowColor, buttonHoverArrowColor, null );
buttonDisabledArrowColor, buttonHoverArrowColor, null, buttonPressedArrowColor, null );
popupButton.setName( "popupButton" );
return popupButton;
}