diff options
Diffstat (limited to 'desktop/modules/appearance')
| -rw-r--r-- | desktop/modules/appearance/Hyprsunset.qml | 13 | ||||
| -rw-r--r-- | desktop/modules/appearance/IdleModule.qml | 1 | ||||
| -rw-r--r-- | desktop/modules/appearance/IdleTab.qml | 9 | ||||
| -rw-r--r-- | desktop/modules/appearance/SunsetModule.qml | 1 | ||||
| -rw-r--r-- | desktop/modules/appearance/SunsetTab.qml | 2 | ||||
| -rw-r--r-- | desktop/modules/appearance/WallpaperModule.qml | 13 | ||||
| -rw-r--r-- | desktop/modules/appearance/WallpaperTab.qml | 11 |
7 files changed, 23 insertions, 27 deletions
diff --git a/desktop/modules/appearance/Hyprsunset.qml b/desktop/modules/appearance/Hyprsunset.qml index 4befcb5..daf07b0 100644 --- a/desktop/modules/appearance/Hyprsunset.qml +++ b/desktop/modules/appearance/Hyprsunset.qml @@ -35,6 +35,9 @@ Singleton { property string cachePathRaw: "~/.config/hyprsunset-qt/sun.json" property string cachePath: `${home}/.config/hyprsunset-qt/sun.json` property string notice: "" + // The last save's outcome, for the SaveBar: notice is location detection. + property string saveNotice: "" + property string saveError: "" property string sunSummary: "" property bool busy: false property bool confLoaded: false @@ -160,6 +163,7 @@ profile { } function refresh() { + root.saveError = ""; confProc.running = false; confProc.running = true; appProc.running = false; @@ -241,13 +245,13 @@ profile { function save() { if (!root.confLoaded || !root.appLoaded) return; for (const p of root.profiles) { - if (!root.validTime(p.time)) { root.notice = `invalid time: ${p.time}`; return; } + if (!root.validTime(p.time)) { root.saveError = `invalid time: ${p.time}`; return; } if (p.temperature !== null && p.temperature !== undefined && !root.validTemperature(p.temperature)) { - root.notice = `invalid temperature: ${p.temperature}`; return; + root.saveError = `invalid temperature: ${p.temperature}`; return; } if (p.gamma !== null && p.gamma !== undefined && !root.validGamma(p.gamma)) { - root.notice = `invalid gamma: ${p.gamma}`; return; + root.saveError = `invalid gamma: ${p.gamma}`; return; } } root.savedConf = root.serializeProfiles(root.profiles); @@ -255,7 +259,8 @@ profile { confFile.setText(root.savedConf); root.saveSettings(); root.restart(); - root.notice = "saved + restarted"; + root.saveError = ""; + root.saveNotice = "saved + restarted"; } // Live preview via the daemon's IPC. Identity wins, then temperature, then diff --git a/desktop/modules/appearance/IdleModule.qml b/desktop/modules/appearance/IdleModule.qml index 2e4f32a..fb911b5 100644 --- a/desktop/modules/appearance/IdleModule.qml +++ b/desktop/modules/appearance/IdleModule.qml @@ -31,6 +31,7 @@ Module { title: "HyprIdle" actions: Component { SaveBar { saveText: "Save + Restart"; dirty: Hypridle.dirty + notice: Hypridle.notice onSave: Hypridle.save(); onDiscard: Hypridle.refresh() } } IdleTab { width: parent.width } diff --git a/desktop/modules/appearance/IdleTab.qml b/desktop/modules/appearance/IdleTab.qml index fdb39ec..f3f2907 100644 --- a/desktop/modules/appearance/IdleTab.qml +++ b/desktop/modules/appearance/IdleTab.qml @@ -83,14 +83,5 @@ Item { } // Save + Restart is in the page header, with every settings page's. - - Text { - width: parent.width - wrapMode: Text.Wrap - visible: Hypridle.notice !== "" - text: Hypridle.notice - color: Theme.green - font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } - } } } diff --git a/desktop/modules/appearance/SunsetModule.qml b/desktop/modules/appearance/SunsetModule.qml index d55d874..2450944 100644 --- a/desktop/modules/appearance/SunsetModule.qml +++ b/desktop/modules/appearance/SunsetModule.qml @@ -31,6 +31,7 @@ Module { title: "HyprSunset" actions: Component { SaveBar { saveText: "Save + Restart"; dirty: Hyprsunset.dirty + notice: Hyprsunset.saveNotice; error: Hyprsunset.saveError onSave: Hyprsunset.save(); onDiscard: Hyprsunset.refresh() } } SunsetTab { width: parent.width } diff --git a/desktop/modules/appearance/SunsetTab.qml b/desktop/modules/appearance/SunsetTab.qml index 26ec264..4f7dfa5 100644 --- a/desktop/modules/appearance/SunsetTab.qml +++ b/desktop/modules/appearance/SunsetTab.qml @@ -158,7 +158,7 @@ Item { wrapMode: Text.Wrap visible: Hyprsunset.notice !== "" text: Hyprsunset.notice - color: Hyprsunset.notice.indexOf("invalid") === 0 ? Theme.red : Theme.green + color: Hyprsunset.notice.indexOf("failed") >= 0 ? Theme.red : Theme.green font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } } } diff --git a/desktop/modules/appearance/WallpaperModule.qml b/desktop/modules/appearance/WallpaperModule.qml index cbc7158..fda7e97 100644 --- a/desktop/modules/appearance/WallpaperModule.qml +++ b/desktop/modules/appearance/WallpaperModule.qml @@ -31,8 +31,17 @@ Module { id: pg title: "Wallpaper" actions: Component { - SaveBar { saveText: "Apply"; discardText: "Reset"; dirty: Wallpapers.dirty; busy: Wallpapers.applying - onSave: Wallpapers.apply(); onDiscard: Wallpapers.clearPending() } + SaveBar { + id: bar + saveText: "Apply"; discardText: "Reset"; dirty: Wallpapers.dirty; busy: Wallpapers.applying + onSave: { bar.error = ""; Wallpapers.apply(); } + onDiscard: { bar.error = ""; Wallpapers.clearPending(); } + // A success closes the window, so only a failure is reported. + Connections { + target: Wallpapers + function onApplied(ok, message) { bar.error = ok ? "" : `wallpaper failed: ${message}`; } + } + } } WallpaperTab { width: parent.width; height: pg.viewHeight; onDismiss: pg.dismiss() } } diff --git a/desktop/modules/appearance/WallpaperTab.qml b/desktop/modules/appearance/WallpaperTab.qml index 3931fcb..a3b3c55 100644 --- a/desktop/modules/appearance/WallpaperTab.qml +++ b/desktop/modules/appearance/WallpaperTab.qml @@ -23,7 +23,6 @@ Column { // What the mock screens show. Hovering a thumbnail previews it on the // targeted screen; the other keeps whatever is currently set. property string hovering: "" - property string notice: "" // Close the window: after a wallpaper is set, so the desk shows, and when // wallhaven-dl opens. signal dismiss @@ -70,7 +69,6 @@ Column { Connections { target: Wallpapers function onApplied(ok, message) { - tab.notice = ok ? "" : `wallpaper failed: ${message}`; if (ok) tab.dismiss(); } } @@ -173,15 +171,6 @@ Column { height: parent.height - mockPane.height - parent.spacing spacing: 12 - Text { - visible: tab.notice !== "" - width: parent.width - wrapMode: Text.Wrap - text: tab.notice - font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } - color: Theme.red - } - Row { spacing: 8 Text { |
