diff options
Diffstat (limited to 'desktop/modules/appearance/ThemeTab.qml')
| -rw-r--r-- | desktop/modules/appearance/ThemeTab.qml | 38 |
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 } } |
