diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java index c3eb1f31..dcf65dd4 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java @@ -254,6 +254,7 @@ public class WindowsTitlePane extends CustomTitlePane { private void installSubcomponents() { titleLabel = new JLabel(); titleLabel.setHorizontalAlignment(JLabel.LEFT); + titleLabel.setFont(getFont()); createIcons(); createActions(); @@ -311,6 +312,12 @@ public class WindowsTitlePane extends CustomTitlePane { setFont(UIManager.getFont("InternalFrame.titleFont", getLocale())); } + @Override + public void setFont(final Font font) { + super.setFont(font); + if (titleLabel != null) titleLabel.setFont(font); + } + protected JButton createWindowIcon() { JButton button = new JButton(); button.putClientProperty("JButton.noShadowOverwrite", true); @@ -702,7 +709,7 @@ public class WindowsTitlePane extends CustomTitlePane { private int computeHeight() { if (hideTitleBar()) return 0; - FontMetrics fm = rootPane.getFontMetrics(getFont()); + FontMetrics fm = titleLabel.getFontMetrics(titleLabel.getFont()); int height = fm.getHeight() + 7; if (menuBarStealer.hasMenuBar()) { height = Math.max(height, menuBarStealer.getMenuBar().getMinimumSize().height);