mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 07:17:13 -06:00
Styling: support styling for recently merged changes
This commit is contained in:
@@ -70,14 +70,14 @@ public class FlatButtonBorder
|
|||||||
@Styleable(dot=true) protected Color defaultFocusColor = UIManager.getColor( "Button.default.focusColor" );
|
@Styleable(dot=true) protected Color defaultFocusColor = UIManager.getColor( "Button.default.focusColor" );
|
||||||
@Styleable(dot=true) protected Color defaultHoverBorderColor = UIManager.getColor( "Button.default.hoverBorderColor" );
|
@Styleable(dot=true) protected Color defaultHoverBorderColor = UIManager.getColor( "Button.default.hoverBorderColor" );
|
||||||
/** @since 1.4 */
|
/** @since 1.4 */
|
||||||
protected final Color toolbarFocusColor = UIManager.getColor( "Button.toolbar.focusColor" );
|
@Styleable(dot=true) protected Color toolbarFocusColor = UIManager.getColor( "Button.toolbar.focusColor" );
|
||||||
|
|
||||||
@Styleable protected int borderWidth = UIManager.getInt( "Button.borderWidth" );
|
@Styleable protected int borderWidth = UIManager.getInt( "Button.borderWidth" );
|
||||||
@Styleable(dot=true) protected int defaultBorderWidth = UIManager.getInt( "Button.default.borderWidth" );
|
@Styleable(dot=true) protected int defaultBorderWidth = UIManager.getInt( "Button.default.borderWidth" );
|
||||||
@Styleable(dot=true) protected Insets toolbarMargin = UIManager.getInsets( "Button.toolbar.margin" );
|
@Styleable(dot=true) protected Insets toolbarMargin = UIManager.getInsets( "Button.toolbar.margin" );
|
||||||
@Styleable(dot=true) protected Insets toolbarSpacingInsets = UIManager.getInsets( "Button.toolbar.spacingInsets" );
|
@Styleable(dot=true) protected Insets toolbarSpacingInsets = UIManager.getInsets( "Button.toolbar.spacingInsets" );
|
||||||
/** @since 1.4 */
|
/** @since 1.4 */
|
||||||
protected final float toolbarFocusWidth = FlatUIUtils.getUIFloat( "Button.toolbar.focusWidth", 1.5f );
|
@Styleable(dot=true) protected float toolbarFocusWidth = FlatUIUtils.getUIFloat( "Button.toolbar.focusWidth", 1.5f );
|
||||||
@Styleable protected int arc = UIManager.getInt( "Button.arc" );
|
@Styleable protected int arc = UIManager.getInt( "Button.arc" );
|
||||||
|
|
||||||
public FlatButtonBorder() {
|
public FlatButtonBorder() {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class FlatToolBarUI
|
|||||||
extends BasicToolBarUI
|
extends BasicToolBarUI
|
||||||
{
|
{
|
||||||
/** @since 1.4 */
|
/** @since 1.4 */
|
||||||
protected boolean focusableButtons;
|
@Styleable protected boolean focusableButtons;
|
||||||
|
|
||||||
// for FlatToolBarBorder
|
// for FlatToolBarBorder
|
||||||
@Styleable protected Insets borderMargins;
|
@Styleable protected Insets borderMargins;
|
||||||
@@ -138,7 +138,12 @@ public class FlatToolBarUI
|
|||||||
* @since TODO
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
protected void applyStyle( Object style ) {
|
protected void applyStyle( Object style ) {
|
||||||
|
boolean oldFocusableButtons = focusableButtons;
|
||||||
|
|
||||||
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
|
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
|
||||||
|
|
||||||
|
if( focusableButtons != oldFocusableButtons )
|
||||||
|
setButtonsFocusable( focusableButtons );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -664,6 +664,8 @@ public class TestFlatStyling
|
|||||||
JToolBar c = new JToolBar();
|
JToolBar c = new JToolBar();
|
||||||
FlatToolBarUI ui = (FlatToolBarUI) c.getUI();
|
FlatToolBarUI ui = (FlatToolBarUI) c.getUI();
|
||||||
|
|
||||||
|
ui.applyStyle( "focusableButtons: true" );
|
||||||
|
|
||||||
ui.applyStyle( "borderMargins: 1,2,3,4" );
|
ui.applyStyle( "borderMargins: 1,2,3,4" );
|
||||||
ui.applyStyle( "gripColor: #fff" );
|
ui.applyStyle( "gripColor: #fff" );
|
||||||
}
|
}
|
||||||
@@ -713,11 +715,13 @@ public class TestFlatStyling
|
|||||||
applyStyle.accept( "default.focusedBorderColor: #fff" );
|
applyStyle.accept( "default.focusedBorderColor: #fff" );
|
||||||
applyStyle.accept( "default.focusColor: #fff" );
|
applyStyle.accept( "default.focusColor: #fff" );
|
||||||
applyStyle.accept( "default.hoverBorderColor: #fff" );
|
applyStyle.accept( "default.hoverBorderColor: #fff" );
|
||||||
|
applyStyle.accept( "toolbar.focusColor: #fff" );
|
||||||
|
|
||||||
applyStyle.accept( "borderWidth: 1" );
|
applyStyle.accept( "borderWidth: 1" );
|
||||||
applyStyle.accept( "default.borderWidth: 2" );
|
applyStyle.accept( "default.borderWidth: 2" );
|
||||||
applyStyle.accept( "toolbar.margin: 1,2,3,4" );
|
applyStyle.accept( "toolbar.margin: 1,2,3,4" );
|
||||||
applyStyle.accept( "toolbar.spacingInsets: 1,2,3,4" );
|
applyStyle.accept( "toolbar.spacingInsets: 1,2,3,4" );
|
||||||
|
applyStyle.accept( "toolbar.focusWidth: {float}1.5" );
|
||||||
applyStyle.accept( "arc: 6" );
|
applyStyle.accept( "arc: 6" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,11 +771,13 @@ public class TestFlatStyling
|
|||||||
border.applyStyleProperty( "default.focusedBorderColor", Color.WHITE );
|
border.applyStyleProperty( "default.focusedBorderColor", Color.WHITE );
|
||||||
border.applyStyleProperty( "default.focusColor", Color.WHITE );
|
border.applyStyleProperty( "default.focusColor", Color.WHITE );
|
||||||
border.applyStyleProperty( "default.hoverBorderColor", Color.WHITE );
|
border.applyStyleProperty( "default.hoverBorderColor", Color.WHITE );
|
||||||
|
border.applyStyleProperty( "toolbar.focusColor", Color.WHITE );
|
||||||
|
|
||||||
border.applyStyleProperty( "borderWidth", 1 );
|
border.applyStyleProperty( "borderWidth", 1 );
|
||||||
border.applyStyleProperty( "default.borderWidth", 2 );
|
border.applyStyleProperty( "default.borderWidth", 2 );
|
||||||
border.applyStyleProperty( "toolbar.margin", new Insets( 1, 2, 3, 4 ) );
|
border.applyStyleProperty( "toolbar.margin", new Insets( 1, 2, 3, 4 ) );
|
||||||
border.applyStyleProperty( "toolbar.spacingInsets", new Insets( 1, 2, 3, 4 ) );
|
border.applyStyleProperty( "toolbar.spacingInsets", new Insets( 1, 2, 3, 4 ) );
|
||||||
|
border.applyStyleProperty( "toolbar.focusWidth", 1.5f );
|
||||||
border.applyStyleProperty( "arc", 6 );
|
border.applyStyleProperty( "arc", 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user