mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 14:30:56 +03:00
Window decorations: fixed iconify, maximize and close icon colors if window is inactive
This commit is contained in:
@@ -18,6 +18,8 @@ FlatLaf Change Log
|
||||
changes in the same way as Swing does it for all other text components. (issue
|
||||
#147)
|
||||
- Demo: Fixed restoring last used theme on startup. (regression in 0.39)
|
||||
- Custom window decorations: Fixed iconify, maximize and close icon colors if
|
||||
window is inactive.
|
||||
|
||||
#### Other Changes
|
||||
|
||||
|
||||
@@ -240,12 +240,15 @@ public class FlatTitlePane
|
||||
protected void activeChanged( boolean active ) {
|
||||
boolean hasEmbeddedMenuBar = rootPane.getJMenuBar() != null && isMenuBarEmbedded();
|
||||
Color background = FlatUIUtils.nonUIResource( active ? activeBackground : inactiveBackground );
|
||||
Color foreground = FlatUIUtils.nonUIResource( active
|
||||
? (hasEmbeddedMenuBar ? embeddedForeground : activeForeground)
|
||||
: inactiveForeground );
|
||||
Color foreground = FlatUIUtils.nonUIResource( active ? activeForeground : inactiveForeground );
|
||||
Color titleForeground = (hasEmbeddedMenuBar && active) ? FlatUIUtils.nonUIResource( embeddedForeground ) : foreground;
|
||||
|
||||
setBackground( background );
|
||||
titleLabel.setForeground( foreground );
|
||||
titleLabel.setForeground( titleForeground );
|
||||
iconifyButton.setForeground( foreground );
|
||||
maximizeButton.setForeground( foreground );
|
||||
restoreButton.setForeground( foreground );
|
||||
closeButton.setForeground( foreground );
|
||||
|
||||
titleLabel.setHorizontalAlignment( hasEmbeddedMenuBar ? SwingConstants.CENTER : SwingConstants.LEADING );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user