From 266a546478e6db93af1b803add4bcbe64bc98e7d Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 8 Jul 2021 16:54:34 +0200 Subject: [PATCH] Window decorations: window title bar width is no longer considered when calculating preferred/minimum width of window (issue #351) --- CHANGELOG.md | 2 ++ .../src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47a82870..4ac0ca56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ FlatLaf Change Log - `2px` at `1.25x` and `2.25x` in **IntelliJ** and **Darcula** themes - OptionPane: Do not make child components, which are derived from `JPanel`, non-opaque. (issue #349) +- Window decorations: Window title bar width is no longer considered when + calculating preferred/minimum width of window. (issue #351) ## 1.3 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java index 185e32c0..35d50741 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java @@ -342,7 +342,7 @@ public class FlatRootPaneUI ? getSizeFunc.apply( rootPane.getContentPane() ) : rootPane.getSize(); - int width = Math.max( titlePaneSize.width, contentSize.width ); + int width = contentSize.width; // title pane width is not considered here int height = titlePaneSize.height + contentSize.height; if( titlePane == null || !titlePane.isMenuBarEmbedded() ) { JMenuBar menuBar = rootPane.getJMenuBar();