diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java index be6346c5..f371679c 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java @@ -86,7 +86,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils; public class FlatCheckBoxIcon extends FlatAbstractIcon { - protected final String style = UIManager.getString( "CheckBox.icon.style" ); + protected final String style = UIManager.getString( getPropertyPrefix() + "icon.style" ); @Styleable protected float focusWidth = getUIFloat( "CheckBox.icon.focusWidth", UIManager.getInt( "Component.focusWidth" ), style ); @Styleable protected Color focusColor = FlatUIUtils.getUIColor( "CheckBox.icon.focusColor", UIManager.getColor( "Component.focusColor" ) ); /** @since 2 */ @Styleable protected float borderWidth = getUIFloat( "CheckBox.icon.borderWidth", FlatUIUtils.getUIFloat( "Component.borderWidth", 1 ), style ); @@ -129,6 +129,10 @@ public class FlatCheckBoxIcon /** @since 2 */ @Styleable protected Color pressedSelectedBackground = getUIColor( "CheckBox.icon.pressedSelectedBackground", style ); /** @since 2 */ @Styleable protected Color pressedCheckmarkColor = getUIColor( "CheckBox.icon.pressedCheckmarkColor", style ); + protected String getPropertyPrefix() { + return "CheckBox."; + } + protected static Color getUIColor( String key, String style ) { if( style != null ) { Color color = UIManager.getColor( styleKey( key, style ) ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java index c2636c84..87df538c 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java @@ -29,6 +29,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable; * is painted outside of the icon bounds. Make sure that the radiobutton * has margins, which are equal or greater than focusWidth. * + * @uiDefault RadioButton.icon.style String optional; "outlined"/null (default) or "filled" * @uiDefault RadioButton.icon.centerDiameter int or float * * @author Karl Tauber @@ -38,6 +39,11 @@ public class FlatRadioButtonIcon { @Styleable protected float centerDiameter = getUIFloat( "RadioButton.icon.centerDiameter", 8, style ); + @Override + protected String getPropertyPrefix() { + return "RadioButton."; + } + @Override protected void paintFocusBorder( Component c, Graphics2D g ) { // the outer focus border is painted outside of the icon diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties index 5603c832..82c080a7 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -155,7 +155,7 @@ CheckBox.icon.pressedBorderColor = $CheckBox.icon.focusedBorderColor CheckBox.icon.pressedBackground = lighten($CheckBox.icon.background,6%,derived) -# used if CheckBox.icon.style = filled +# used if CheckBox.icon.style or RadioButton.icon.style = filled # enabled CheckBox.icon[filled].selectedBorderColor = $CheckBox.icon.checkmarkColor CheckBox.icon[filled].selectedBackground = $CheckBox.icon.checkmarkColor diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties index 510b9c2e..d0c256be 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties @@ -64,3 +64,8 @@ Component.focusWidth = 2 Component.innerFocusWidth = 0 Component.innerOutlineWidth = 0 Component.arrowType = triangle + + +#---- RadioButton ---- + +RadioButton.icon.style = filled diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties index b87e47d6..544280e0 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -158,7 +158,7 @@ CheckBox.icon.pressedBorderColor = $CheckBox.icon.focusedBorderColor CheckBox.icon.pressedBackground = darken($CheckBox.icon.background,10%,derived) -# used if CheckBox.icon.style = filled +# used if CheckBox.icon.style or RadioButton.icon.style = filled # enabled CheckBox.icon[filled].selectedBorderColor = shade($CheckBox.icon[filled].selectedBackground,5%) CheckBox.icon[filled].selectedBackground = @accentCheckmarkColor diff --git a/flatlaf-testing/dumps/uidefaults/FlatIntelliJLaf_1.8.0.txt b/flatlaf-testing/dumps/uidefaults/FlatIntelliJLaf_1.8.0.txt index 943c0881..f579ab89 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatIntelliJLaf_1.8.0.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatIntelliJLaf_1.8.0.txt @@ -100,6 +100,11 @@ + PasswordField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI] +#---- RadioButton ---- + ++ RadioButton.icon.style filled + + #---- ScrollPane ---- - ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] diff --git a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt index 565950b2..9d35f08c 100644 --- a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt +++ b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt @@ -601,6 +601,7 @@ RadioButton.foreground RadioButton.highlight RadioButton.icon RadioButton.icon.centerDiameter +RadioButton.icon.style RadioButton.iconTextGap RadioButton.icon[filled].centerDiameter RadioButton.light