mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 22:47:13 -06:00
ToolBar: foolbars are no longer floatable by default
This commit is contained in:
@@ -51,6 +51,7 @@ import com.formdev.flatlaf.util.LoggingFacade;
|
||||
* <!-- FlatToolBarUI -->
|
||||
*
|
||||
* @uiDefault ToolBar.focusableButtons boolean
|
||||
* @uiDefault ToolBar.floatable boolean
|
||||
*
|
||||
* <!-- FlatToolBarBorder -->
|
||||
*
|
||||
@@ -70,6 +71,7 @@ public class FlatToolBarUI
|
||||
@Styleable protected Insets borderMargins;
|
||||
@Styleable protected Color gripColor;
|
||||
|
||||
private Boolean oldFloatable;
|
||||
private Map<String, Object> oldStyleValues;
|
||||
|
||||
public static ComponentUI createUI( JComponent c ) {
|
||||
@@ -103,6 +105,23 @@ public class FlatToolBarUI
|
||||
super.installDefaults();
|
||||
|
||||
focusableButtons = UIManager.getBoolean( "ToolBar.focusableButtons" );
|
||||
|
||||
// floatable
|
||||
if( !UIManager.getBoolean( "ToolBar.floatable" ) ) {
|
||||
oldFloatable = toolBar.isFloatable();
|
||||
toolBar.setFloatable( false );
|
||||
} else
|
||||
oldFloatable = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults() {
|
||||
super.uninstallDefaults();
|
||||
|
||||
if( oldFloatable != null ) {
|
||||
toolBar.setFloatable( oldFloatable );
|
||||
oldFloatable = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -760,6 +760,8 @@ ToggleButton.tab.focusBackground = $TabbedPane.focusColor
|
||||
ToolBar.border = com.formdev.flatlaf.ui.FlatToolBarBorder
|
||||
ToolBar.borderMargins = 2,2,2,2
|
||||
ToolBar.isRollover = true
|
||||
ToolBar.floatable = false
|
||||
ToolBar.focusableButtons = false
|
||||
ToolBar.gripColor = @icon
|
||||
ToolBar.dockingBackground = darken($ToolBar.background,5%)
|
||||
ToolBar.dockingForeground = $Component.borderColor
|
||||
@@ -770,8 +772,9 @@ ToolBar.separatorSize = null
|
||||
ToolBar.separatorWidth = 7
|
||||
ToolBar.separatorColor = $Separator.foreground
|
||||
|
||||
# not used in FlatLaf; intended for custom components in toolbar
|
||||
# https://github.com/JFormDesigner/FlatLaf/issues/56#issuecomment-586297814
|
||||
ToolBar.spacingBorder = $Button.toolbar.spacingInsets
|
||||
ToolBar.focusableButtons = false
|
||||
|
||||
|
||||
#---- ToolTipManager ----
|
||||
|
||||
Reference in New Issue
Block a user