Skip to content

Commit 897671e

Browse files
committed
Add accent-list-view style class
1 parent 9d5d708 commit 897671e

8 files changed

Lines changed: 71 additions & 0 deletions

File tree

shellfx-material/src/main/java/com/techsenger/shellfx/material/style/StyleClasses.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,12 @@ public interface StyleClasses {
194194
* (e.g. CheckBox).
195195
*/
196196
String READ_ONLY = "read-only";
197+
198+
/**
199+
* Style class for a {@code ListView} whose cells are highlighted with the theme's accent color on hover,
200+
* rather than the default neutral highlight. Intended for menu-like lists where a click immediately selects
201+
* an item and closes the containing popup (e.g. the {@code LocationBar} segment/storage popups), as opposed
202+
* to persistent-selection data lists such as file or directory listings.
203+
*/
204+
String ACCENT_LIST_VIEW = "accent-list-view";
197205
}

shellfx-material/src/main/resources/com/techsenger/shellfx/material/style/material-cupertino-dark.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,13 @@
8181

8282
.shadow {
8383
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 8px, 0.6, 0, 2);
84+
}
85+
86+
.list-view.accent-list-view .list-cell:filled:hover {
87+
-fx-background-color: -color-accent-emphasis;
88+
-fx-text-fill: -color-fg-emphasis;
89+
}
90+
91+
.list-view.accent-list-view .list-cell:filled:hover .font-icon-view {
92+
-fx-fill: -color-fg-emphasis;
8493
}

shellfx-material/src/main/resources/com/techsenger/shellfx/material/style/material-cupertino-light.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,13 @@
8181

8282
.shadow {
8383
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 6px, 0.3, 0, 2);
84+
}
85+
86+
.list-view.accent-list-view .list-cell:filled:hover {
87+
-fx-background-color: -color-accent-emphasis;
88+
-fx-text-fill: -color-fg-emphasis;
89+
}
90+
91+
.list-view.accent-list-view .list-cell:filled:hover .font-icon-view {
92+
-fx-fill: -color-fg-emphasis;
8493
}

shellfx-material/src/main/resources/com/techsenger/shellfx/material/style/material-dracula.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,12 @@
8383
.shadow {
8484
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 8px, 0.6, 0, 2);
8585
}
86+
87+
.list-view.accent-list-view .list-cell:filled:hover {
88+
-fx-background-color: -color-accent-emphasis;
89+
-fx-text-fill: -color-fg-emphasis;
90+
}
91+
92+
.list-view.accent-list-view .list-cell:filled:hover .font-icon-view {
93+
-fx-fill: -color-fg-emphasis;
94+
}

shellfx-material/src/main/resources/com/techsenger/shellfx/material/style/material-nord-dark.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,13 @@
8181

8282
.shadow {
8383
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 8px, 0.6, 0, 2);
84+
}
85+
86+
.list-view.accent-list-view .list-cell:filled:hover {
87+
-fx-background-color: -color-base-8;
88+
-fx-text-fill: -color-fg-default;
89+
}
90+
91+
.list-view.accent-list-view .list-cell:filled:hover .font-icon-view {
92+
-fx-fill: -color-fg-default;
8493
}

shellfx-material/src/main/resources/com/techsenger/shellfx/material/style/material-nord-light.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,13 @@
8181

8282
.shadow {
8383
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 6px, 0.3, 0, 2);
84+
}
85+
86+
.list-view.accent-list-view .list-cell:filled:hover {
87+
-fx-background-color: -color-base-1;
88+
-fx-text-fill: -color-fg-default;
89+
}
90+
91+
.list-view.accent-list-view .list-cell:filled:hover .font-icon-view {
92+
-fx-fill: -color-fg-default;
8493
}

shellfx-material/src/main/resources/com/techsenger/shellfx/material/style/material-primer-dark.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,13 @@
8181

8282
.shadow {
8383
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 8px, 0.6, 0, 2);
84+
}
85+
86+
.list-view.accent-list-view .list-cell:filled:hover {
87+
-fx-background-color: -color-base-7;
88+
-fx-text-fill: -color-fg-default;
89+
}
90+
91+
.list-view.accent-list-view .list-cell:filled:hover .font-icon-view {
92+
-fx-fill: -color-fg-default;
8493
}

shellfx-material/src/main/resources/com/techsenger/shellfx/material/style/material-primer-light.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,13 @@
8181

8282
.shadow {
8383
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 6px, 0.3, 0, 2);
84+
}
85+
86+
.list-view.accent-list-view .list-cell:filled:hover {
87+
-fx-background-color: -color-base-1;
88+
-fx-text-fill: -color-fg-default;
89+
}
90+
91+
.list-view.accent-list-view .list-cell:filled:hover .font-icon-view {
92+
-fx-fill: -color-fg-default;
8493
}

0 commit comments

Comments
 (0)