Button and ToggleButton: ToolBar buttons now respect explicitly set background color. If no background color is set, then the button background is not painted anymore (issue #191)

This commit is contained in:
Karl Tauber
2021-01-13 17:22:09 +01:00
parent 8d14d5f87c
commit b49a498f9c
4 changed files with 51 additions and 10 deletions

View File

@@ -410,8 +410,13 @@ public class FlatButtonUI
if( model.isRollover() )
return toolbarHoverBackground;
// use background of toolbar
return c.getParent().getBackground();
// use component background if explicitly set
Color bg = c.getBackground();
if( isCustomBackground( bg ) )
return bg;
// do not paint background
return null;
}
boolean def = isDefaultButton( c );