mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 22:47:13 -06:00
Window decorations: make embedded menu bar make smaller if horizontal space is rare to avoid that embedded menu bar overlaps buttons
This commit is contained in:
@@ -62,6 +62,7 @@ public class FlatTestFrame
|
||||
private FlatInspector inspector;
|
||||
|
||||
public boolean useApplyComponentOrientation;
|
||||
public boolean applyComponentOrientationToFrame;
|
||||
|
||||
public static FlatTestFrame create( String[] args, String title ) {
|
||||
DemoPrefs.init( PREFS_ROOT_PATH );
|
||||
@@ -439,7 +440,9 @@ public class FlatTestFrame
|
||||
? ComponentOrientation.RIGHT_TO_LEFT
|
||||
: ComponentOrientation.LEFT_TO_RIGHT;
|
||||
|
||||
if( useApplyComponentOrientation )
|
||||
if( applyComponentOrientationToFrame )
|
||||
applyComponentOrientation( orientation );
|
||||
else if( useApplyComponentOrientation )
|
||||
content.applyComponentOrientation( orientation );
|
||||
else {
|
||||
updateComponentsRecur( content, (c, type) -> {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class FlatWindowDecorationsTest
|
||||
JDialog.setDefaultLookAndFeelDecorated( true );
|
||||
|
||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatWindowDecorationsTest" );
|
||||
frame.applyComponentOrientationToFrame = true;
|
||||
|
||||
// WARNING: Do not this in real-world programs.
|
||||
// frame.setUndecorated( true );
|
||||
|
||||
Reference in New Issue
Block a user