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:
Karl Tauber
2020-08-06 23:10:54 +02:00
parent b0426b81a7
commit 56ebd26361
4 changed files with 33 additions and 2 deletions

View File

@@ -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) -> {

View File

@@ -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 );