mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
ToolBar: foolbars are no longer floatable by default
This commit is contained in:
@@ -13,6 +13,9 @@ FlatLaf Change Log
|
||||
- Theming improvements: Reworks core themes to make it easier to create new
|
||||
themes (e.g. reduced explicit colors by using color functions). **Note**:
|
||||
There are minor incompatible changes in FlatLaf properties files. (PR #390)
|
||||
- ToolBar: Toolbars are no longer floatable by default (dots on left side of
|
||||
toolbar that allows dragging toolbar). Use `UIManager.put(
|
||||
"ToolBar.floatable", true )` if you want the old behavior.
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
|
||||
@@ -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 ----
|
||||
|
||||
@@ -1268,6 +1268,7 @@ ToolBar.borderMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI]
|
||||
ToolBar.darkShadow #7a7d7f HSL 204 2 49 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.dockingBackground #303234 HSL 210 4 20 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.dockingForeground #616365 HSL 210 2 39 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.floatable false
|
||||
ToolBar.floatingBackground #3c3f41 HSL 204 4 25 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.floatingForeground #616365 HSL 210 2 39 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.focusableButtons false
|
||||
|
||||
@@ -1273,6 +1273,7 @@ ToolBar.borderMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI]
|
||||
ToolBar.darkShadow #9c9c9c HSL 0 0 61 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.dockingBackground #e5e5e5 HSL 0 0 90 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.dockingForeground #c2c2c2 HSL 0 0 76 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.floatable false
|
||||
ToolBar.floatingBackground #f2f2f2 HSL 0 0 95 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.floatingForeground #c2c2c2 HSL 0 0 76 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.focusableButtons false
|
||||
|
||||
@@ -1281,6 +1281,7 @@ ToolBar.borderMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI]
|
||||
ToolBar.darkShadow #696969 HSL 0 0 41 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.dockingBackground #b3ffb3 HSL 120 100 85 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.dockingForeground #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.floatable false
|
||||
ToolBar.floatingBackground #ccffcc HSL 120 100 90 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.floatingForeground #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToolBar.focusableButtons true
|
||||
|
||||
@@ -989,6 +989,7 @@ ToolBar.borderMargins
|
||||
ToolBar.darkShadow
|
||||
ToolBar.dockingBackground
|
||||
ToolBar.dockingForeground
|
||||
ToolBar.floatable
|
||||
ToolBar.floatingBackground
|
||||
ToolBar.floatingForeground
|
||||
ToolBar.focusableButtons
|
||||
|
||||
Reference in New Issue
Block a user