OptionPane: fixed OptionPane.sameSizeButtons, which did not work as expected when setting to false

This commit is contained in:
Karl Tauber
2021-08-23 16:53:23 +02:00
parent 543b977db7
commit 97ca866ffa
2 changed files with 9 additions and 0 deletions

View File

@@ -14,6 +14,8 @@ FlatLaf Change Log
pressed) when running in Java 9+ on Linux, macOS. Occurs also on Windows in
large popup menus that do not fit into the window. (issue #371; regression
since FlatLaf 1.3)
- OptionPane: Fixed `OptionPane.sameSizeButtons`, which did not work as expected
when setting to `false`.
## 1.5

View File

@@ -91,6 +91,7 @@ public class FlatOptionPaneUI
protected int messagePadding;
protected int maxCharactersPerLine;
private int focusWidth;
private boolean sameSizeButtons;
public static ComponentUI createUI( JComponent c ) {
return new FlatOptionPaneUI();
@@ -104,6 +105,7 @@ public class FlatOptionPaneUI
messagePadding = UIManager.getInt( "OptionPane.messagePadding" );
maxCharactersPerLine = UIManager.getInt( "OptionPane.maxCharactersPerLine" );
focusWidth = UIManager.getInt( "Component.focusWidth" );
sameSizeButtons = FlatUIUtils.getUIBoolean( "OptionPane.sameSizeButtons", true );
}
@Override
@@ -217,6 +219,11 @@ public class FlatOptionPaneUI
return null;
}
@Override
protected boolean getSizeButtonsToSameWidth() {
return sameSizeButtons;
}
//---- class NonUIResourceBorder ------------------------------------------
private static class NonUIResourceBorder