From e3cac95d37a3a634fec1eb4c969f4522d6394be3 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 8 Jan 2021 18:03:09 +0100 Subject: [PATCH] UI defaults: - moved some common properties from FlatLightLaf.properties and FlatDarkLaf.properties to FlatLaf.properties - use color functions for more properties --- .../formdev/flatlaf/FlatDarkLaf.properties | 18 ++++++++------- .../com/formdev/flatlaf/FlatLaf.properties | 22 +++++++++++-------- .../formdev/flatlaf/FlatLightLaf.properties | 18 ++++++++------- .../uidefaults/FlatDarkLaf_1.8.0_202.txt | 2 +- .../flatlaf/testing/FlatTestLaf.properties | 10 +++++---- 5 files changed, 40 insertions(+), 30 deletions(-) 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 bdd60937..f405154e 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -36,6 +36,12 @@ @cellFocusColor = #000 @icon = #adadad +# for buttons within components (e.g. combobox or spinner) +@buttonArrowColor = #9A9DA1 +@buttonDisabledArrowColor = darken(@buttonArrowColor,25%) +@buttonHoverArrowColor = lighten(@buttonArrowColor,10%,derived noAutoInverse) +@buttonPressedArrowColor = lighten(@buttonArrowColor,20%,derived noAutoInverse) + # Drop (use lazy colors for IntelliJ platform themes, which usually do not specify these colors) @dropCellBackground = darken(List.selectionBackground,10%,lazy) @dropCellForeground = lazy(List.selectionForeground) @@ -62,8 +68,8 @@ Button.selectedForeground = @foreground Button.disabledSelectedBackground = lighten($Button.background,3%,derived) Button.borderColor = #5e6060 -Button.disabledBorderColor = #5e6060 -Button.focusedBorderColor = #466d94 +Button.disabledBorderColor = $Button.borderColor +Button.focusedBorderColor = $Component.focusedBorderColor Button.hoverBorderColor = $Button.focusedBorderColor Button.default.background = #365880 @@ -119,11 +125,7 @@ CheckBox.icon[filled].selectedPressedBackground = darken($CheckBox.icon[filled]. #---- ComboBox ---- -ComboBox.buttonEditableBackground = #404445 -ComboBox.buttonArrowColor = #9A9DA1 -ComboBox.buttonDisabledArrowColor = darken($ComboBox.buttonArrowColor,25%) -ComboBox.buttonHoverArrowColor = lighten($ComboBox.buttonArrowColor,10%,derived noAutoInverse) -ComboBox.buttonPressedArrowColor = lighten($ComboBox.buttonArrowColor,20%,derived noAutoInverse) +ComboBox.buttonEditableBackground = darken($ComboBox.background,2%) #---- Component ---- @@ -307,4 +309,4 @@ ToolTip.background = #1e2123 #---- Tree ---- -Tree.hash = #505355 +Tree.hash = lighten($Tree.background,5%) 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 f0076a87..c8a34016 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -203,6 +203,10 @@ ComboBox.maximumRowCount = 15 ComboBox.buttonStyle = auto ComboBox.background = @textComponentBackground ComboBox.buttonBackground = @textComponentBackground +ComboBox.buttonArrowColor = @buttonArrowColor +ComboBox.buttonDisabledArrowColor = @buttonDisabledArrowColor +ComboBox.buttonHoverArrowColor = @buttonHoverArrowColor +ComboBox.buttonPressedArrowColor = @buttonPressedArrowColor #---- Component ---- @@ -474,8 +478,8 @@ ScrollBar.hoverThumbWithTrack = false ScrollBar.pressedThumbWithTrack = false ScrollBar.showButtons = false ScrollBar.squareButtons = false -ScrollBar.buttonArrowColor = $ComboBox.buttonArrowColor -ScrollBar.buttonDisabledArrowColor = $ComboBox.buttonDisabledArrowColor +ScrollBar.buttonArrowColor = @buttonArrowColor +ScrollBar.buttonDisabledArrowColor = @buttonDisabledArrowColor ScrollBar.allowsAbsolutePositioning = true [mac]ScrollBar.minimumThumbSize = 18,18 @@ -516,10 +520,10 @@ Slider.focusWidth = 4 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.buttonPressedArrowColor = $ComboBox.buttonPressedArrowColor +Spinner.buttonArrowColor = @buttonArrowColor +Spinner.buttonDisabledArrowColor = @buttonDisabledArrowColor +Spinner.buttonHoverArrowColor = @buttonHoverArrowColor +Spinner.buttonPressedArrowColor = @buttonPressedArrowColor Spinner.padding = @textComponentMargin Spinner.editorBorderPainted = false # allowed values: button or none @@ -536,9 +540,9 @@ SplitPane.oneTouchButtonSize = {scaledInteger}6 SplitPane.oneTouchButtonOffset = {scaledInteger}2 SplitPaneDivider.border = null -SplitPaneDivider.oneTouchArrowColor = $ComboBox.buttonArrowColor -SplitPaneDivider.oneTouchHoverArrowColor = $ComboBox.buttonHoverArrowColor -SplitPaneDivider.oneTouchPressedArrowColor = $ComboBox.buttonPressedArrowColor +SplitPaneDivider.oneTouchArrowColor = @buttonArrowColor +SplitPaneDivider.oneTouchHoverArrowColor = @buttonHoverArrowColor +SplitPaneDivider.oneTouchPressedArrowColor = @buttonPressedArrowColor # allowed values: grip or plain SplitPaneDivider.style = grip SplitPaneDivider.gripColor = @icon 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 a3892348..8a23f71d 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -36,6 +36,12 @@ @cellFocusColor = #000 @icon = #afafaf +# for buttons within components (e.g. combobox or spinner) +@buttonArrowColor = #666 +@buttonDisabledArrowColor = lighten(@buttonArrowColor,25%) +@buttonHoverArrowColor = lighten(@buttonArrowColor,20%,derived noAutoInverse) +@buttonPressedArrowColor = lighten(@buttonArrowColor,30%,derived noAutoInverse) + # Drop (use lazy colors for IntelliJ platform themes, which usually do not specify these colors) @dropCellBackground = lighten(List.selectionBackground,10%,lazy) @dropCellForeground = lazy(List.selectionForeground) @@ -47,8 +53,8 @@ activeCaption = #99b4d1 inactiveCaption = #bfcddb -controlHighlight = #e3e3e3 -controlLtHighlight = #fff +controlHighlight = lighten($controlShadow,12%) +controlLtHighlight = lighten($controlShadow,25%) controlDkShadow = darken($controlShadow,15%) @@ -126,11 +132,7 @@ CheckBox.icon[filled].selectedPressedBackground = darken($CheckBox.icon[filled]. #---- ComboBox ---- -ComboBox.buttonEditableBackground = #fafafa -ComboBox.buttonArrowColor = #666 -ComboBox.buttonDisabledArrowColor = lighten($ComboBox.buttonArrowColor,25%) -ComboBox.buttonHoverArrowColor = lighten($ComboBox.buttonArrowColor,20%,derived noAutoInverse) -ComboBox.buttonPressedArrowColor = lighten($ComboBox.buttonArrowColor,30%,derived noAutoInverse) +ComboBox.buttonEditableBackground = darken($ComboBox.background,2%) #---- Component ---- @@ -319,4 +321,4 @@ ToolTip.background = #fafafa #---- Tree ---- -Tree.hash = #E6E6E6 +Tree.hash = darken($Tree.background,10%) diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt index 96f8175b..c08e7ccb 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -1246,7 +1246,7 @@ Tree.editorBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] Tree.font [active] $defaultFont [UI] Tree.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Tree.hash #505355 javax.swing.plaf.ColorUIResource [UI] +Tree.hash #515657 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #adadad javax.swing.plaf.ColorUIResource [UI] Tree.icon.collapsedColor #adadad javax.swing.plaf.ColorUIResource [UI] Tree.icon.expandedColor #adadad javax.swing.plaf.ColorUIResource [UI] 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 cf0c38a8..fef4f47f 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 @@ -32,6 +32,12 @@ @cellFocusColor = #f00 @icon = #afafaf +# for buttons within components (e.g. combobox or spinner) +@buttonArrowColor = #666 +@buttonDisabledArrowColor = #ABABAB +@buttonHoverArrowColor = #f00 +@buttonPressedArrowColor = #00f + @dropCellBackground = #f00 @dropCellForeground = #0f0 @dropLineColor = #00f @@ -118,10 +124,6 @@ CheckBox.icon.pressedBackground = #FFC800 ComboBox.background = #fff ComboBox.buttonBackground = #f0f0f0 ComboBox.buttonEditableBackground = #ccc -ComboBox.buttonArrowColor = #666 -ComboBox.buttonDisabledArrowColor = #ABABAB -ComboBox.buttonHoverArrowColor = #f00 -ComboBox.buttonPressedArrowColor = #00f #---- Component ----