diff --git a/CHANGELOG.md b/CHANGELOG.md index 58709069..cf6f3fc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ FlatLaf Change Log `rgba(red,green,blue,alpha)`, `hsl(hue,saturation,lightness)`, `hsla(hue,saturation,lightness,alpha)`, `lighten(color,amount[,options])` and `darken(color,amount[,options])`. +- Replaced prefix `@@` with `$` in `.properties` files. - Fixed link color (in HTML text) and separator color in IntelliJ platform themes. diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java index aae60c2b..493ab0af 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java @@ -61,7 +61,9 @@ class UIDefaultsLoader private static final String TYPE_PREFIX = "{"; private static final String TYPE_PREFIX_END = "}"; private static final String VARIABLE_PREFIX = "@"; + @Deprecated private static final String REF_PREFIX = VARIABLE_PREFIX + "@"; + private static final String PROPERTY_PREFIX = "$"; private static final String OPTIONAL_PREFIX = "?"; private static final String GLOBAL_PREFIX = "*."; @@ -176,16 +178,21 @@ class UIDefaultsLoader } static void logParseError( String key, String value, RuntimeException ex ) { - System.err.println( "Failed to parse: '" + key + '=' + value + '\'' ); + System.err.println( "FlatLaf: Failed to parse: '" + key + '=' + value + '\'' ); System.err.println( " " + ex.getMessage() ); } private static String resolveValue( Properties properties, String value ) { - if( !value.startsWith( VARIABLE_PREFIX ) ) + if( value.startsWith( PROPERTY_PREFIX ) ) + value = value.substring( PROPERTY_PREFIX.length() ); + else if( !value.startsWith( VARIABLE_PREFIX ) ) return value; - if( value.startsWith( REF_PREFIX ) ) + // for compatibility + if( value.startsWith( REF_PREFIX ) ) { + System.err.println( "FlatLaf: Usage of '@@' in .properties files is deprecated. Use '$' instead." ); value = value.substring( REF_PREFIX.length() ); + } boolean optional = false; if( value.startsWith( OPTIONAL_PREFIX ) ) { @@ -198,7 +205,7 @@ class UIDefaultsLoader if( optional ) return "null"; - throw new IllegalArgumentException( "variable or reference '" + value + "' not found" ); + throw new IllegalArgumentException( "variable or property '" + value + "' not found" ); } return resolveValue( properties, newValue ); 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 c6ca1f4d..9abd79e0 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -73,7 +73,7 @@ Button.pressedBackground=@buttonPressedBackground Button.borderColor=#5e6060 Button.disabledBorderColor=#5e6060 Button.focusedBorderColor=#466d94 -Button.hoverBorderColor=@@Button.focusedBorderColor +Button.hoverBorderColor=$Button.focusedBorderColor Button.default.background=#365880 Button.default.foreground=#bbbbbb @@ -95,7 +95,7 @@ CheckBox.icon.borderColor=#6B6B6B CheckBox.icon.disabledBorderColor=#545556 CheckBox.icon.selectedBorderColor=#6B6B6B CheckBox.icon.focusedBorderColor=#466D94 -CheckBox.icon.hoverBorderColor=@@CheckBox.icon.focusedBorderColor +CheckBox.icon.hoverBorderColor=$CheckBox.icon.focusedBorderColor CheckBox.icon.selectedFocusedBorderColor=#466D94 CheckBox.icon.background=#43494A CheckBox.icon.disabledBackground=@background diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index f4d2424f..12304c0c 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -65,9 +65,9 @@ ViewportUI=com.formdev.flatlaf.ui.FlatViewportUI desktop=@textComponentBackground activeCaptionText=@foreground -activeCaptionBorder=@@activeCaption +activeCaptionBorder=$activeCaption inactiveCaptionText=@foreground -inactiveCaptionBorder=@@inactiveCaption +inactiveCaptionBorder=$inactiveCaption window=@background windowBorder=@foreground windowText=@foreground @@ -80,8 +80,8 @@ textHighlightText=@selectionForeground textInactiveText=@disabledText control=@background controlText=@foreground -scrollbar=@@ScrollBar.track -info=@@ToolTip.background +scrollbar=$ScrollBar.track +info=$ToolTip.background infoText=@foreground @@ -180,17 +180,17 @@ FormattedTextField.placeholderForeground=@disabledText #---- HelpButton ---- HelpButton.icon=com.formdev.flatlaf.icons.FlatHelpButtonIcon -HelpButton.borderColor=@@CheckBox.icon.borderColor -HelpButton.disabledBorderColor=@@CheckBox.icon.disabledBorderColor -HelpButton.focusedBorderColor=@@CheckBox.icon.focusedBorderColor -HelpButton.hoverBorderColor=@@?CheckBox.icon.hoverBorderColor -HelpButton.background=@@CheckBox.icon.background -HelpButton.disabledBackground=@@CheckBox.icon.disabledBackground -HelpButton.focusedBackground=@@?CheckBox.icon.focusedBackground -HelpButton.hoverBackground=@@?CheckBox.icon.hoverBackground -HelpButton.pressedBackground=@@?CheckBox.icon.pressedBackground -HelpButton.questionMarkColor=@@CheckBox.icon.checkmarkColor -HelpButton.disabledQuestionMarkColor=@@CheckBox.icon.disabledCheckmarkColor +HelpButton.borderColor=$CheckBox.icon.borderColor +HelpButton.disabledBorderColor=$CheckBox.icon.disabledBorderColor +HelpButton.focusedBorderColor=$CheckBox.icon.focusedBorderColor +HelpButton.hoverBorderColor=$?CheckBox.icon.hoverBorderColor +HelpButton.background=$CheckBox.icon.background +HelpButton.disabledBackground=$CheckBox.icon.disabledBackground +HelpButton.focusedBackground=$?CheckBox.icon.focusedBackground +HelpButton.hoverBackground=$?CheckBox.icon.hoverBackground +HelpButton.pressedBackground=$?CheckBox.icon.pressedBackground +HelpButton.questionMarkColor=$CheckBox.icon.checkmarkColor +HelpButton.disabledQuestionMarkColor=$CheckBox.icon.disabledCheckmarkColor #---- List ---- @@ -299,14 +299,14 @@ RadioButtonMenuItem.margin=2,2,2,2 ScrollBar.width=10 ScrollBar.showButtons=false ScrollBar.squareButtons=false -ScrollBar.buttonArrowColor=@@ComboBox.buttonArrowColor -ScrollBar.buttonDisabledArrowColor=@@ComboBox.buttonDisabledArrowColor +ScrollBar.buttonArrowColor=$ComboBox.buttonArrowColor +ScrollBar.buttonDisabledArrowColor=$ComboBox.buttonDisabledArrowColor #---- ScrollPane ---- ScrollPane.border=com.formdev.flatlaf.ui.FlatBorder -ScrollPane.background=@@ScrollBar.track +ScrollPane.background=$ScrollBar.track ScrollPane.fillUpperCorner=true @@ -328,10 +328,10 @@ Slider.thumbWidth=11 Spinner.border=com.formdev.flatlaf.ui.FlatRoundBorder Spinner.background=@textComponentBackground -Spinner.buttonBackground=@@ComboBox.buttonEditableBackground -Spinner.buttonArrowColor=@@ComboBox.buttonArrowColor -Spinner.buttonDisabledArrowColor=@@ComboBox.buttonDisabledArrowColor -Spinner.buttonHoverArrowColor=@@ComboBox.buttonHoverArrowColor +Spinner.buttonBackground=$ComboBox.buttonEditableBackground +Spinner.buttonArrowColor=$ComboBox.buttonArrowColor +Spinner.buttonDisabledArrowColor=$ComboBox.buttonDisabledArrowColor +Spinner.buttonHoverArrowColor=$ComboBox.buttonHoverArrowColor Spinner.padding=@textComponentMargin Spinner.editorBorderPainted=false @@ -346,7 +346,7 @@ SplitPane.oneTouchButtonSize={scaledInteger}6 SplitPane.oneTouchButtonOffset={scaledInteger}2 SplitPaneDivider.border=null -SplitPaneDivider.oneTouchArrowColor=@@ComboBox.buttonArrowColor +SplitPaneDivider.oneTouchArrowColor=$ComboBox.buttonArrowColor #---- TabbedPane ---- @@ -360,7 +360,7 @@ TabbedPane.tabAreaInsets=0,0,0,0 TabbedPane.selectedTabPadInsets=0,0,0,0 TabbedPane.tabRunOverlay=0 TabbedPane.tabsOverlapBorder=true -TabbedPane.shadow=@@ComboBox.buttonArrowColor +TabbedPane.shadow=$ComboBox.buttonArrowColor #---- Table ---- @@ -409,7 +409,7 @@ TextPane.background=@textComponentBackground #---- TitledBorder ---- TitledBorder.titleColor=@foreground -TitledBorder.border=1,1,1,1,@@Separator.foreground +TitledBorder.border=1,1,1,1,$Separator.foreground #---- ToggleButton ---- @@ -419,11 +419,11 @@ ToggleButton.margin=2,14,2,14 ToggleButton.iconTextGap=4 ToggleButton.rollover=true -ToggleButton.background=@@Button.background -ToggleButton.pressedBackground=@@Button.pressedBackground +ToggleButton.background=$Button.background +ToggleButton.pressedBackground=$Button.pressedBackground -ToggleButton.toolbar.hoverBackground=@@Button.toolbar.hoverBackground -ToggleButton.toolbar.pressedBackground=@@Button.toolbar.pressedBackground +ToggleButton.toolbar.hoverBackground=$Button.toolbar.hoverBackground +ToggleButton.toolbar.pressedBackground=$Button.toolbar.pressedBackground #---- ToolBar ---- @@ -437,14 +437,14 @@ ToolBar.floatingBackground=@background ToolBar.separatorSize=null ToolBar.separatorWidth=7 -ToolBar.separatorColor=@@Separator.foreground +ToolBar.separatorColor=$Separator.foreground #---- ToolTip ---- -ToolTip.border=4,6,4,6,@@Component.borderColor +ToolTip.border=4,6,4,6,$Component.borderColor ToolTip.borderInactive=null -ToolTip.backgroundInactive=@@ToolTip.background +ToolTip.backgroundInactive=$ToolTip.background ToolTip.foregroundInactive=@disabledText 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 368b6ff3..174ddfaf 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -71,20 +71,20 @@ Button.focusedBackground=#e3f1fa Button.hoverBackground=@buttonHoverBackground Button.pressedBackground=@buttonPressedBackground -Button.borderColor=@@Component.borderColor -Button.disabledBorderColor=@@Component.disabledBorderColor -Button.focusedBorderColor=@@Component.focusedBorderColor -Button.hoverBorderColor=@@Button.focusedBorderColor +Button.borderColor=$Component.borderColor +Button.disabledBorderColor=$Component.disabledBorderColor +Button.focusedBorderColor=$Component.focusedBorderColor +Button.hoverBorderColor=$Button.focusedBorderColor -Button.default.background=@@Button.background +Button.default.background=$Button.background Button.default.foreground=@foreground -Button.default.focusedBackground=@@Button.focusedBackground +Button.default.focusedBackground=$Button.focusedBackground Button.default.hoverBackground=@buttonHoverBackground Button.default.pressedBackground=@buttonPressedBackground Button.default.borderColor=#4F9EE3 -Button.default.hoverBorderColor=@@Button.hoverBorderColor -Button.default.focusedBorderColor=@@Button.focusedBorderColor -Button.default.focusColor=@@Component.focusColor +Button.default.hoverBorderColor=$Button.hoverBorderColor +Button.default.focusedBorderColor=$Button.focusedBorderColor +Button.default.focusColor=$Component.focusColor Button.default.borderWidth=2 Button.toolbar.hoverBackground=#dfdfdf @@ -95,12 +95,12 @@ Button.toolbar.pressedBackground=#d8d8d8 CheckBox.icon.borderColor=#b0b0b0 CheckBox.icon.disabledBorderColor=#BDBDBD -CheckBox.icon.selectedBorderColor=@@CheckBox.icon.borderColor +CheckBox.icon.selectedBorderColor=$CheckBox.icon.borderColor CheckBox.icon.focusedBorderColor=#7B9FC7 -CheckBox.icon.hoverBorderColor=@@CheckBox.icon.focusedBorderColor +CheckBox.icon.hoverBorderColor=$CheckBox.icon.focusedBorderColor CheckBox.icon.background=#FFFFFF CheckBox.icon.disabledBackground=@background -CheckBox.icon.focusedBackground=@@Button.focusedBackground +CheckBox.icon.focusedBackground=$Button.focusedBackground CheckBox.icon.hoverBackground=@buttonHoverBackground CheckBox.icon.pressedBackground=@buttonPressedBackground CheckBox.icon.selectedBackground=#FFFFFF diff --git a/flatlaf-jide-oss/src/main/resources/com/formdev/flatlaf/jideoss/FlatLaf.properties b/flatlaf-jide-oss/src/main/resources/com/formdev/flatlaf/jideoss/FlatLaf.properties index 582f5cc1..3cd194af 100644 --- a/flatlaf-jide-oss/src/main/resources/com/formdev/flatlaf/jideoss/FlatLaf.properties +++ b/flatlaf-jide-oss/src/main/resources/com/formdev/flatlaf/jideoss/FlatLaf.properties @@ -21,7 +21,7 @@ JideTabbedPaneUI=com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI #---- JidePopup ---- -Resizable.resizeBorder=4,4,4,4,@@PopupMenu.borderColor +Resizable.resizeBorder=4,4,4,4,$PopupMenu.borderColor #---- JideTabbedPane ---- @@ -30,8 +30,8 @@ JideTabbedPane.background=@background JideTabbedPane.foreground=@foreground JideTabbedPane.tabAreaBackground=@background -JideTabbedPane.tabInsets=@@TabbedPane.tabInsets -JideTabbedPane.tabAreaInsets=@@TabbedPane.tabAreaInsets +JideTabbedPane.tabInsets=$TabbedPane.tabInsets +JideTabbedPane.tabAreaInsets=$TabbedPane.tabAreaInsets JideTabbedPane.contentBorderInsets=0,0,0,0 -JideTabbedPane.tabRunOverlay=@@TabbedPane.tabRunOverlay -JideTabbedPane.shadow=@@TabbedPane.shadow +JideTabbedPane.tabRunOverlay=$TabbedPane.tabRunOverlay +JideTabbedPane.shadow=$TabbedPane.shadow diff --git a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties index c5b486ca..4565a9b7 100644 --- a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties +++ b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties @@ -29,7 +29,7 @@ JXHeader.startBackground=#4c5052 #---- Hyperlink ---- Hyperlink.linkColor=#589df6 -Hyperlink.visitedColor=@@Hyperlink.linkColor +Hyperlink.visitedColor=$Hyperlink.linkColor Hyperlink.disabledText=@disabledText @@ -58,7 +58,7 @@ TaskPaneContainer.border=10,10,10,10 #---- TaskPane ---- TaskPane.background=@background -TaskPane.borderColor=@@Button.borderColor +TaskPane.borderColor=$Button.borderColor TaskPane.contentInsets=10,10,10,10 TaskPane.titleBackgroundGradientStart=#4c5052 diff --git a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLaf.properties b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLaf.properties index 36050a91..3d0ca7b7 100644 --- a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLaf.properties +++ b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLaf.properties @@ -38,7 +38,7 @@ JXMonthView.monthUpFileName={icon}com.formdev.flatlaf.swingx.ui.FlatMonthUpIcon #---- TitledPanel ---- -JXTitledPanel.borderColor=@@Button.borderColor -JXTitledPanel.titleBackground=@@TaskPane.titleBackgroundGradientStart -JXTitledPanel.titleForeground=@@TaskPane.titleForeground +JXTitledPanel.borderColor=$Button.borderColor +JXTitledPanel.titleBackground=$TaskPane.titleBackgroundGradientStart +JXTitledPanel.titleForeground=$TaskPane.titleForeground JXTitledPanel.captionInsets=4,10,4,10 diff --git a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties index 4bee107c..b0b4a002 100644 --- a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties +++ b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties @@ -28,8 +28,8 @@ JXHeader.startBackground=#ffffff #---- Hyperlink ---- -Hyperlink.linkColor=@@Component.linkColor -Hyperlink.visitedColor=@@Hyperlink.linkColor +Hyperlink.linkColor=$Component.linkColor +Hyperlink.visitedColor=$Hyperlink.linkColor Hyperlink.disabledText=@disabledText @@ -58,7 +58,7 @@ TaskPaneContainer.border=10,10,10,10 #---- TaskPane ---- TaskPane.background=@background -TaskPane.borderColor=@@Button.borderColor +TaskPane.borderColor=$Button.borderColor TaskPane.contentInsets=10,10,10,10 TaskPane.titleBackgroundGradientStart=#dfdfdf diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties index f88f0b2f..aedae037 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties @@ -214,7 +214,7 @@ Separator.stripeIndent=5 Slider.trackColor=#00bb00 Slider.thumbColor=#880000 Slider.tickColor=#ff0000 -Slider.focusedColor=@@Component.focusColor +Slider.focusedColor=$Component.focusColor Slider.hoverColor=#0000ff Slider.disabledForeground=#000088 diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties index 26906b8e..1e6639ae 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties @@ -73,4 +73,4 @@ TaskPane.specialTitleOver=#dd0000 #---- TitledPanel ---- -JXTitledPanel.borderColor=@@Button.startBorderColor +JXTitledPanel.borderColor=$Button.startBorderColor