Window decorations:

- enabled `TitlePane.unifiedBackground` by default (because seems to be standard on Windows 11)
- no longer paint a bottom separator for the menu bar (if unified background is enabled)
This commit is contained in:
Karl Tauber
2021-11-10 15:49:47 +01:00
parent 005c9f471e
commit 80a8348a99
8 changed files with 19 additions and 8 deletions

View File

@@ -53,6 +53,9 @@ public class FlatMenuBarBorder
@Override
public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) {
if( !showBottomSeparator() )
return;
float lineHeight = scale( (float) 1 );
FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight );
}
@@ -68,4 +71,9 @@ public class FlatMenuBarBorder
insets.right = scale( margin.right );
return insets;
}
/** @since 2 */
protected boolean showBottomSeparator() {
return !UIManager.getBoolean( "TitlePane.unifiedBackground" );
}
}

View File

@@ -709,7 +709,7 @@ TitledBorder.border = 1,1,1,1,$Separator.foreground
TitlePane.useWindowDecorations = true
TitlePane.menuBarEmbedded = true
TitlePane.unifiedBackground = false
TitlePane.unifiedBackground = true
TitlePane.showIcon = true
TitlePane.noIconLeftGap = 8
TitlePane.iconSize = 16,16