From 81c35eab4631cad089d61d6df63a94f5801e1c7c Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 7 Dec 2020 12:28:31 +0100 Subject: [PATCH] SwingX: fixed striping background highlighting color (e.g. alternating table rows) in dark themes Table: made grid lines slightly darker/lighter --- CHANGELOG.md | 8 ++++++++ .../resources/com/formdev/flatlaf/FlatDarkLaf.properties | 2 +- .../resources/com/formdev/flatlaf/FlatLightLaf.properties | 2 +- .../com/formdev/flatlaf/swingx/FlatDarkLaf.properties | 5 +++++ .../com/formdev/flatlaf/swingx/FlatLightLaf.properties | 5 +++++ .../dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt | 7 ++++++- .../dumps/uidefaults/FlatLightLaf_1.8.0_202.txt | 7 ++++++- .../com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt | 1 + 8 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 066597ed..d7a408f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ FlatLaf Change Log ================== +## 0.46-SNAPSHOT + +#### Fixed bugs + +- SwingX: Fixed striping background highlighting color (e.g. alternating table + rows) in dark themes. + + ## 0.45 #### New features and improvements 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 201e8cd5..0839f741 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -275,7 +275,7 @@ TabbedPane.closePressedForeground=$TabbedPane.closeHoverForeground #---- Table ---- -Table.gridColor=lighten($Table.background,3%) +Table.gridColor=lighten($Table.background,5%) #---- TableHeader ---- 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 db395e08..528ec370 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -287,7 +287,7 @@ TabbedPane.closePressedForeground=$TabbedPane.closeHoverForeground #---- Table ---- -Table.gridColor=darken($Table.background,3%) +Table.gridColor=darken($Table.background,5%) #---- TableHeader ---- 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 98e3238d..f3ec2b98 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 @@ -26,6 +26,11 @@ JXHeader.background=@background JXHeader.startBackground=#4c5052 +#---- HighlighterFactory ---- + +UIColorHighlighter.stripingBackground=lighten(@textComponentBackground,5%) + + #---- Hyperlink ---- Hyperlink.linkColor=#589df6 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 84e09193..094a29fe 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 @@ -26,6 +26,11 @@ JXHeader.background=@background JXHeader.startBackground=#fff +#---- HighlighterFactory ---- + +UIColorHighlighter.stripingBackground=darken(@textComponentBackground,5%) + + #---- Hyperlink ---- Hyperlink.linkColor=$Component.linkColor 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 1c7e4b6f..551fcb67 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -995,7 +995,7 @@ Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.F Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 Table.font [active] $defaultFont [UI] Table.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Table.gridColor #4c5152 javax.swing.plaf.ColorUIResource [UI] +Table.gridColor #515657 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] Table.rowHeight 20 Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] @@ -1273,6 +1273,11 @@ Tree.wideSelection true TreeUI com.formdev.flatlaf.ui.FlatTreeUI +#---- UIColorHighlighter ---- + +UIColorHighlighter.stripingBackground #515657 javax.swing.plaf.ColorUIResource [UI] + + #---- Viewport ---- Viewport.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt index d522dd47..d96e0e19 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -1000,7 +1000,7 @@ Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.F Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 Table.font [active] $defaultFont [UI] Table.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -Table.gridColor #f7f7f7 javax.swing.plaf.ColorUIResource [UI] +Table.gridColor #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] Table.rowHeight 20 Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] @@ -1278,6 +1278,11 @@ Tree.wideSelection true TreeUI com.formdev.flatlaf.ui.FlatTreeUI +#---- UIColorHighlighter ---- + +UIColorHighlighter.stripingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] + + #---- Viewport ---- Viewport.background #f2f2f2 javax.swing.plaf.ColorUIResource [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 e09ea5df..8016d60d 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 @@ -928,6 +928,7 @@ Tree.textForeground Tree.timeFactor Tree.wideSelection TreeUI +UIColorHighlighter.stripingBackground Viewport.background Viewport.font Viewport.foreground