aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/appearance/ThemeTab.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-22 17:26:57 +0200
committerDanilo M. <danix@danix.xyz>2026-10-22 17:26:57 +0200
commitb810188a4b106ee84e1971b0bbd928d27528171f (patch)
treea41ba51ecb5129d42e5e3504e6d726ae2c0f98a5 /desktop/modules/appearance/ThemeTab.qml
parent9d9e67a14967fe756c357b0ece3d9f339f8afa17 (diff)
downloadquickshell-b810188a4b106ee84e1971b0bbd928d27528171f.tar.gz
quickshell-b810188a4b106ee84e1971b0bbd928d27528171f.zip
theme: stage a scheme and commit it from the header
The Theme page applied a scheme on click, so a stray click reinstalled the whole theme, and it was the one settings page without the header's commit point. Clicking now stages the scheme (outlined yellow, "selected"), and Reset / Apply in the header drop or apply it, as the wallpaper page does. The applied notice and any failure moved into the SaveBar, and the sidebar marks the page dirty while a scheme is staged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/appearance/ThemeTab.qml')
-rw-r--r--desktop/modules/appearance/ThemeTab.qml38
1 files changed, 10 insertions, 28 deletions
diff --git a/desktop/modules/appearance/ThemeTab.qml b/desktop/modules/appearance/ThemeTab.qml
index acee97a..b842c32 100644
--- a/desktop/modules/appearance/ThemeTab.qml
+++ b/desktop/modules/appearance/ThemeTab.qml
@@ -13,32 +13,12 @@ import QtQuick
import "../.."
// Colour schemes from unified-desktop-theme, each with its swatches and a mock
-// of a panel in its colours. Clicking one applies it through install.sh.
+// of a panel in its colours. Clicking one stages it; Apply in the header runs
+// install.sh, as the wallpaper page does.
Column {
id: tab
spacing: 10
- // install.sh reloads Hyprland, kitty and conky; this says what it cannot
- // reach, or why it failed.
- property string notice: ""
- Connections {
- target: Udt
- function onApplied(scheme, ok, message) {
- tab.notice = ok
- ? `${scheme} applied. Restart Qt, GTK, btop and Joplin; neovim needs :colorscheme udt.`
- : `failed: ${message}`;
- }
- }
-
- Text {
- visible: tab.notice !== ""
- width: parent.width
- wrapMode: Text.Wrap
- text: tab.notice
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 }
- color: tab.notice.indexOf("failed") === 0 ? Theme.red : Theme.green
- }
-
Repeater {
model: Udt.names
@@ -48,6 +28,7 @@ Column {
objectName: modelData
readonly property var sw: Udt.swatches[modelData] ?? ({})
readonly property bool isCurrent: Udt.current === modelData
+ readonly property bool isPending: Udt.pending === modelData && !isCurrent
width: tab.width
implicitHeight: 96
@@ -55,14 +36,15 @@ Column {
color: hover.hovered ? Qt.alpha(Theme.surface, 0.75)
: Qt.alpha(Theme.surface, 0.35)
border.width: 1
- border.color: isCurrent ? Qt.alpha(Theme.accent, 0.6) : "transparent"
+ border.color: isPending ? Theme.yellow
+ : isCurrent ? Qt.alpha(Theme.accent, 0.6) : "transparent"
HoverHandler { id: hover }
MouseArea {
anchors.fill: parent
- enabled: !Udt.applying && !isCurrent
+ enabled: !Udt.applying
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
- onClicked: Udt.apply(modelData)
+ onClicked: Udt.pending = isCurrent ? "" : modelData
}
Row {
@@ -150,10 +132,10 @@ Column {
}
Text {
anchors.verticalCenter: parent.verticalCenter
- visible: Udt.applying
- text: "applying…"
+ visible: isPending
+ text: Udt.applying ? "applying…" : "selected"
font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 }
- color: Theme.overlay
+ color: Theme.yellow
}
}