Window decorations: no longer reduce height of window title bar if it has an embedded menu bar and is maximized

This commit is contained in:
Karl Tauber
2022-07-10 14:03:45 +02:00
parent cddbb3d7d4
commit 52feaac92a
2 changed files with 3 additions and 1 deletions

View File

@@ -14,6 +14,8 @@ FlatLaf Change Log
- Window title now has a minimum width to always allow moving window
(click-and-drag on window title). Instead, embedded menu bar is made
smaller.
- No longer reduce height of window title bar if it has an embedded menu bar
and is maximized.
#### Fixed bugs

View File

@@ -265,7 +265,7 @@ public class FlatTitlePane
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
if( buttonMaximizedHeight > 0 && isWindowMaximized() ) {
if( buttonMaximizedHeight > 0 && isWindowMaximized() && !hasVisibleEmbeddedMenuBar( rootPane.getJMenuBar() ) ) {
// make title pane height smaller when frame is maximized
size = new Dimension( size.width, Math.min( size.height, UIScale.scale( buttonMaximizedHeight ) ) );
}