diff --git a/CHANGELOG.md b/CHANGELOG.md index 61db7e54..44d85bfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java index 8ef90297..f86cd12b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java @@ -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 );