mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
ToggleButton: tab style buttons now respect explicitly set background color
This commit is contained in:
@@ -30,6 +30,8 @@ FlatLaf Change Log
|
|||||||
- Button and ToggleButton: ToolBar buttons now respect explicitly set background
|
- Button and ToggleButton: ToolBar buttons now respect explicitly set background
|
||||||
color. If no background color is set, then the button background is not
|
color. If no background color is set, then the button background is not
|
||||||
painted anymore. (issue #191)
|
painted anymore. (issue #191)
|
||||||
|
- ToggleButton: Tab style buttons (client property `JButton.buttonType` is
|
||||||
|
`tab`) now respect explicitly set background color.
|
||||||
- TabbedPane: Fixed `IndexOutOfBoundsException` when using tooltip text on close
|
- TabbedPane: Fixed `IndexOutOfBoundsException` when using tooltip text on close
|
||||||
buttons and closing last/rightmost tab. (issue #235)
|
buttons and closing last/rightmost tab. (issue #235)
|
||||||
- Extras: Added missing export of package
|
- Extras: Added missing export of package
|
||||||
|
|||||||
@@ -146,10 +146,17 @@ public class FlatToggleButtonUI
|
|||||||
int height = c.getHeight();
|
int height = c.getHeight();
|
||||||
int width = c.getWidth();
|
int width = c.getWidth();
|
||||||
boolean selected = ((AbstractButton)c).isSelected();
|
boolean selected = ((AbstractButton)c).isSelected();
|
||||||
|
Color enabledColor = selected ? clientPropertyColor( c, TAB_BUTTON_SELECTED_BACKGROUND, tabSelectedBackground ) : null;
|
||||||
|
|
||||||
|
// use component background if explicitly set
|
||||||
|
if( enabledColor == null ) {
|
||||||
|
Color bg = c.getBackground();
|
||||||
|
if( isCustomBackground( bg ) )
|
||||||
|
enabledColor = bg;
|
||||||
|
}
|
||||||
|
|
||||||
// paint background
|
// paint background
|
||||||
Color background = buttonStateColor( c,
|
Color background = buttonStateColor( c, enabledColor,
|
||||||
selected ? clientPropertyColor( c, TAB_BUTTON_SELECTED_BACKGROUND, tabSelectedBackground ) : null,
|
|
||||||
null, tabFocusBackground, tabHoverBackground, null );
|
null, tabFocusBackground, tabHoverBackground, null );
|
||||||
if( background != null ) {
|
if( background != null ) {
|
||||||
g.setColor( background );
|
g.setColor( background );
|
||||||
|
|||||||
Reference in New Issue
Block a user