mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 15:27:16 -06:00
Native window decorations: avoid double window title bar if enabling native window border failed (issue #315)
This commit is contained in:
@@ -125,6 +125,10 @@ public class FlatNativeWindowBorder
|
|||||||
// enable native window border for window
|
// enable native window border for window
|
||||||
setHasCustomDecoration( frame, true );
|
setHasCustomDecoration( frame, true );
|
||||||
|
|
||||||
|
// avoid double window title bar if enabling native window border failed
|
||||||
|
if( !hasCustomDecoration( frame ) )
|
||||||
|
return;
|
||||||
|
|
||||||
// enable Swing window decoration
|
// enable Swing window decoration
|
||||||
rootPane.setWindowDecorationStyle( JRootPane.FRAME );
|
rootPane.setWindowDecorationStyle( JRootPane.FRAME );
|
||||||
|
|
||||||
@@ -143,6 +147,10 @@ public class FlatNativeWindowBorder
|
|||||||
// enable native window border for window
|
// enable native window border for window
|
||||||
setHasCustomDecoration( dialog, true );
|
setHasCustomDecoration( dialog, true );
|
||||||
|
|
||||||
|
// avoid double window title bar if enabling native window border failed
|
||||||
|
if( !hasCustomDecoration( dialog ) )
|
||||||
|
return;
|
||||||
|
|
||||||
// enable Swing window decoration
|
// enable Swing window decoration
|
||||||
rootPane.setWindowDecorationStyle( JRootPane.PLAIN_DIALOG );
|
rootPane.setWindowDecorationStyle( JRootPane.PLAIN_DIALOG );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -308,6 +308,8 @@ class FlatWindowsNativeWindowBorder
|
|||||||
this.window = window;
|
this.window = window;
|
||||||
|
|
||||||
hwnd = installImpl( window );
|
hwnd = installImpl( window );
|
||||||
|
if( hwnd == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
// remove the OS window title bar
|
// remove the OS window title bar
|
||||||
if( window instanceof JFrame && ((JFrame)window).getExtendedState() != 0 ) {
|
if( window instanceof JFrame && ((JFrame)window).getExtendedState() != 0 ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user