Convert theme classes to pseudo classes

This commit is contained in:
crschnick
2025-06-05 22:38:39 +00:00
parent 1c69aebc4e
commit 855bc11c22
11 changed files with 31 additions and 30 deletions

View File

@@ -56,7 +56,7 @@ public class AppTheme {
PseudoClass.getPseudoClass(OsType.getLocal().getId()), true);
if (AppPrefs.get() == null) {
var def = Theme.getDefaultLightTheme();
root.getStyleClass().add(def.getCssId());
root.pseudoClassStateChanged(PseudoClass.getPseudoClass(def.getCssId()), true);
root.pseudoClassStateChanged(LIGHT, true);
root.pseudoClassStateChanged(DARK, false);
root.pseudoClassStateChanged(PRETTY, true);
@@ -65,12 +65,13 @@ public class AppTheme {
}
AppPrefs.get().theme().subscribe(t -> {
Theme.ALL.forEach(theme -> root.getStyleClass().remove(theme.getCssId()));
Theme.ALL.forEach(theme -> {
root.pseudoClassStateChanged(PseudoClass.getPseudoClass(theme.getCssId()), theme.equals(t));
});
if (t == null) {
return;
}
root.getStyleClass().add(t.getCssId());
root.pseudoClassStateChanged(LIGHT, !t.isDark());
root.pseudoClassStateChanged(DARK, t.isDark());
});

View File

@@ -1,6 +1,6 @@
.root.nord .bookmarks-header .filter-comp {
.root:nord .bookmarks-header .filter-comp {
-fx-border-radius: 0;
-fx-background-radius: 0;
}

View File

@@ -37,7 +37,7 @@
-fx-padding: 0.1em 0.2em;
}
.root.nord .transfer > * {
.root:nord .transfer > * {
-fx-background-radius: 0;
-fx-border-radius: 0;
}
@@ -89,7 +89,7 @@
-fx-background-radius: 4;
}
.root.nord .browser .terminal-dock-comp:empty {
.root:nord .browser .terminal-dock-comp:empty {
-fx-border-radius: 0;
-fx-background-radius: 0;
}
@@ -267,7 +267,7 @@
-fx-padding: 0 4 4 0;
}
.root.nord .browser .browser-content {
.root:nord .browser .browser-content {
-fx-border-radius: 0;
-fx-background-radius: 0;
}
@@ -328,11 +328,11 @@
-fx-background-color: -color-warning-subtle;
}
.root:dark.nord .browser .table-row-cell:selected, .root:dark.nord .browser .table-row-cell:hover:selected {
.root:dark:nord .browser .table-row-cell:selected, .root:dark:nord .browser .table-row-cell:hover:selected {
-fx-background-color: -color-success-7;
}
.root:light.nord .browser .table-row-cell:selected, .root:light.nord .browser .table-row-cell:hover:selected {
.root:light:nord .browser .table-row-cell:selected, .root:light:nord .browser .table-row-cell:hover:selected {
-fx-background-color: -color-success-1;
}
@@ -361,7 +361,7 @@
-fx-opacity: 1.0;
}
.root.nord .browser .tab-container {
.root:nord .browser .tab-container {
-fx-border-radius: 0;
-fx-background-radius: 0;
}

View File

@@ -47,7 +47,7 @@
-fx-padding: 0 0 0 0;
}
.root:seamless-frame.nord .layout > .background {
.root:seamless-frame:nord .layout > .background {
-fx-background-radius: 0 0 0 0;
-fx-border-radius: 0 0 0 0;
-fx-border-width: 1 1 0 0;
@@ -62,7 +62,7 @@
-fx-border-color: -color-border-default;
}
.root:dark:seamless-frame.primer .layout > .background, .root:dark:seamless-frame.mocha .layout > .background {
.root:dark:seamless-frame:primer .layout > .background, .root:dark:seamless-frame:mocha .layout > .background {
-fx-border-color: #444;
}
@@ -76,7 +76,7 @@
-fx-border-radius: 0 6 0 0;
}
.root:seamless-frame.nord .layout > .background > * {
.root:seamless-frame:nord .layout > .background > * {
-fx-background-radius: 0 0 0 0;
-fx-border-radius: 0 0 0 0;
}

View File

@@ -15,12 +15,12 @@
-fx-spacing: 0.45em;
}
.root.nord .store-header-bar {
.root:nord .store-header-bar {
-fx-background-radius: 0;
-fx-border-radius: 0;
}
.root.nord .bar {
.root:nord .bar {
-fx-background-radius: 0;
-fx-border-radius: 0;
}
@@ -38,7 +38,7 @@
-fx-border-color: transparent;
}
.root.nord .store-header-bar .menu-button {
.root:nord .store-header-bar .menu-button {
-fx-background-radius: 0;
-fx-border-radius: 0;
}
@@ -51,7 +51,7 @@
-fx-padding: -5 -2 -5 -2;
}
.root.primer:macos .store-header-bar .menu-button, .root.nord:macos .store-header-bar .menu-button, .root.dracula:macos .store-header-bar .menu-button, .root.mocha:macos .store-header-bar .menu-button {
.root:primer:macos .store-header-bar .menu-button, .root:nord:macos .store-header-bar .menu-button, .root:dracula:macos .store-header-bar .menu-button, .root:mocha:macos .store-header-bar .menu-button {
-fx-padding: -5 -2 -5 -2;
}
@@ -94,7 +94,7 @@
-fx-spacing: 0.2em;
}
.root.nord .store-creation-bar, .root.nord .store-sort-bar, .root.nord .store-category-bar {
.root:nord .store-creation-bar, .root:nord .store-sort-bar, .root:nord .store-category-bar {
-fx-background-radius: 0;
-fx-border-radius: 0;
}
@@ -155,7 +155,7 @@
-fx-border-radius: 3px;
}
.root.nord .store-header-bar .filter-bar {
.root:nord .store-header-bar .filter-bar {
-fx-background-radius: 0;
-fx-border-radius: 0;
}

View File

@@ -57,7 +57,7 @@
-fx-border-color: -color-border-default;
}
.root.nord .context-menu {
.root:nord .context-menu {
-fx-padding: 0;
-fx-background-radius:0;
-fx-border-radius: 0;

View File

@@ -56,7 +56,7 @@
-fx-background-radius: 4;
}
.root.nord .prefs .sidebar {
.root:nord .prefs .sidebar {
-fx-border-radius: 0;
-fx-background-radius: 0;
}
@@ -68,7 +68,7 @@
-fx-background-insets: 0, 1 4 1 4;
}
.root.nord .prefs .sidebar .button {
.root:nord .prefs .sidebar .button {
-fx-background-radius: 0, 0, 0;
}

View File

@@ -12,7 +12,7 @@
-fx-border-radius: 4;
}
.root.nord .store-entry-list-status-bar .button {
.root:nord .store-entry-list-status-bar .button {
-fx-border-radius: 0;
}
@@ -74,7 +74,7 @@
-fx-background-radius: 5px;
}
.root.nord .store-entry-grid .icon {
.root:nord .store-entry-grid .icon {
-fx-background-radius: 3;
}
@@ -94,7 +94,7 @@
-fx-background-radius: 4px;
}
.root.nord .store-entry-comp {
.root:nord .store-entry-comp {
-fx-background-radius: 0;
}
@@ -181,7 +181,7 @@
-fx-padding: 0;
}
.root.nord .store-entry-section-comp {
.root:nord .store-entry-section-comp {
-fx-border-radius: 0;
-fx-background-radius: 0;
}

View File

@@ -10,7 +10,7 @@
-fx-background-radius: 0;
}
.root.nord .store-section-mini-comp .item:hover, .root.nord:key-navigation .store-section-mini-comp .item:focused {
.root:nord .store-section-mini-comp .item:hover, .root:nord:key-navigation .store-section-mini-comp .item:focused {
-fx-background-color: -color-accent-muted;
}
@@ -81,7 +81,7 @@
-fx-border-color: #3339;
}
.root.nord .store-section-mini-comp:sub:expanded {
.root:nord .store-section-mini-comp:sub:expanded {
-fx-border-radius: 0;
}

View File

@@ -125,7 +125,7 @@
-fx-border-color: -color-fg-subtle;
}
.root.nord .icon-button-comp.batch-mode-button {
.root:nord .icon-button-comp.batch-mode-button {
-fx-border-radius: 0;
-fx-background-radius: 0;
}

View File

@@ -4,7 +4,7 @@
-fx-background-radius: 4px;
}
.root.nord .tile-button-comp {
.root:nord .tile-button-comp {
-fx-background-radius: 0;
}