From de1b0b1bb614b05ae97e27e1532b61b5ef020b9c Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 3 Apr 2021 11:51:45 +0200 Subject: [PATCH] MenuBar: do not use `TitlePane.unifiedBackground` if window decorations are disabled for the window --- .../src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java index f17053e7..67a67e3e 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java @@ -104,8 +104,9 @@ public class FlatMenuBarUI // do not paint background for unified title pane // (not storing value of "TitlePane.unifiedBackground" in class to allow changing at runtime) - if( UIManager.getBoolean( "TitlePane.unifiedBackground" ) ) - return false; + if( UIManager.getBoolean( "TitlePane.unifiedBackground" ) && + FlatNativeWindowBorder.hasCustomDecoration( (Window) rootPane.getParent() ) ) + return false; // paint background in full screen mode if( FlatUIUtils.isFullScreen( rootPane ) )