mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
Native window decorations: removed superfluous pixel-line at top of screen when window is maximized (issue #296)
This commit is contained in:
@@ -6,6 +6,8 @@ FlatLaf Change Log
|
||||
#### Fixed bugs
|
||||
|
||||
- Fixed crash when running in Webswing. (issue #290)
|
||||
- Native window decorations: Removed superfluous pixel-line at top of screen
|
||||
when window is maximized. (issue #296)
|
||||
|
||||
|
||||
## 1.1.1
|
||||
|
||||
@@ -803,7 +803,7 @@ debug*/
|
||||
} else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) )
|
||||
insets.bottom += UIScale.scale( 1 );
|
||||
|
||||
if( hasNativeCustomDecoration() )
|
||||
if( hasNativeCustomDecoration() && !isWindowMaximized( c ) )
|
||||
insets = FlatUIUtils.addInsets( insets, WindowTopBorder.getInstance().getBorderInsets() );
|
||||
|
||||
return insets;
|
||||
@@ -822,7 +822,7 @@ debug*/
|
||||
FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight );
|
||||
}
|
||||
|
||||
if( hasNativeCustomDecoration() )
|
||||
if( hasNativeCustomDecoration() && !isWindowMaximized( c ) )
|
||||
WindowTopBorder.getInstance().paintBorder( c, g, x, y, width, height );
|
||||
}
|
||||
|
||||
@@ -830,6 +830,12 @@ debug*/
|
||||
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||
return hasVisibleEmbeddedMenuBar( menuBar ) ? menuBar.getBorder() : null;
|
||||
}
|
||||
|
||||
protected boolean isWindowMaximized( Component c ) {
|
||||
return window instanceof Frame
|
||||
? (((Frame)window).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0
|
||||
: false;
|
||||
}
|
||||
}
|
||||
|
||||
//---- class FlatTitleLabelUI ---------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user