mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 06:20:53 +03:00
Button: fixed background and foreground colors for borderless and toolBarButton style default buttons (JButton.isDefaultButton() is true) (issue #947)
This commit is contained in:
@@ -16,6 +16,9 @@ FlatLaf Change Log
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- Button: Fixed background and foreground colors for `borderless` and
|
||||
`toolBarButton` style default buttons (`JButton.isDefaultButton()` is `true`).
|
||||
(issue #947)
|
||||
- FileChooser: Improved performance when navigating to large directories with
|
||||
thousands of files. (issue #953)
|
||||
- PopupFactory: Fixed NPE on Windows 10 when `owner` is `null`. (issue #952)
|
||||
|
||||
@@ -653,7 +653,8 @@ public class FlatButtonUI
|
||||
}
|
||||
|
||||
protected Color getBackground( JComponent c ) {
|
||||
boolean toolBarButton = isToolBarButton( c ) || isBorderlessButton( c );
|
||||
boolean def = isDefaultButton( c );
|
||||
boolean toolBarButton = !def && (isToolBarButton( c ) || isBorderlessButton( c ));
|
||||
|
||||
// selected state
|
||||
if( ((AbstractButton)c).isSelected() ) {
|
||||
@@ -681,7 +682,6 @@ public class FlatButtonUI
|
||||
toolbarPressedBackground );
|
||||
}
|
||||
|
||||
boolean def = isDefaultButton( c );
|
||||
return buttonStateColor( c,
|
||||
getBackgroundBase( c, def ),
|
||||
disabledBackground,
|
||||
@@ -733,7 +733,8 @@ public class FlatButtonUI
|
||||
|
||||
protected Color getForeground( JComponent c ) {
|
||||
Color fg = c.getForeground();
|
||||
boolean toolBarButton = isToolBarButton( c ) || isBorderlessButton( c );
|
||||
boolean def = isDefaultButton( c );
|
||||
boolean toolBarButton = !def && (isToolBarButton( c ) || isBorderlessButton( c ));
|
||||
|
||||
// selected state
|
||||
if( ((AbstractButton)c).isSelected() ) {
|
||||
@@ -759,7 +760,6 @@ public class FlatButtonUI
|
||||
toolbarPressedForeground );
|
||||
}
|
||||
|
||||
boolean def = isDefaultButton( c );
|
||||
return buttonStateColor( c,
|
||||
getForegroundBase( c, def ),
|
||||
disabledText,
|
||||
|
||||
Reference in New Issue
Block a user