mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 06:50: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
|
changes in the same way as Swing does it for all other text components. (issue
|
||||||
#147)
|
#147)
|
||||||
- Demo: Fixed restoring last used theme on startup. (regression in 0.39)
|
- 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
|
#### Other Changes
|
||||||
|
|
||||||
|
|||||||
@@ -240,12 +240,15 @@ public class FlatTitlePane
|
|||||||
protected void activeChanged( boolean active ) {
|
protected void activeChanged( boolean active ) {
|
||||||
boolean hasEmbeddedMenuBar = rootPane.getJMenuBar() != null && isMenuBarEmbedded();
|
boolean hasEmbeddedMenuBar = rootPane.getJMenuBar() != null && isMenuBarEmbedded();
|
||||||
Color background = FlatUIUtils.nonUIResource( active ? activeBackground : inactiveBackground );
|
Color background = FlatUIUtils.nonUIResource( active ? activeBackground : inactiveBackground );
|
||||||
Color foreground = FlatUIUtils.nonUIResource( active
|
Color foreground = FlatUIUtils.nonUIResource( active ? activeForeground : inactiveForeground );
|
||||||
? (hasEmbeddedMenuBar ? embeddedForeground : activeForeground)
|
Color titleForeground = (hasEmbeddedMenuBar && active) ? FlatUIUtils.nonUIResource( embeddedForeground ) : foreground;
|
||||||
: inactiveForeground );
|
|
||||||
|
|
||||||
setBackground( background );
|
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 );
|
titleLabel.setHorizontalAlignment( hasEmbeddedMenuBar ? SwingConstants.CENTER : SwingConstants.LEADING );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user