aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/appearance/WallpaperTab.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/appearance/WallpaperTab.qml')
-rw-r--r--desktop/modules/appearance/WallpaperTab.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/desktop/modules/appearance/WallpaperTab.qml b/desktop/modules/appearance/WallpaperTab.qml
index 640f1ef..134c90e 100644
--- a/desktop/modules/appearance/WallpaperTab.qml
+++ b/desktop/modules/appearance/WallpaperTab.qml
@@ -142,12 +142,42 @@ Column {
color: Wallpapers.qualityColor(subject, Wallpapers.target)
}
+ Text {
+ width: parent.width
+ visible: Wallpapers.upscaleError !== ""
+ wrapMode: Text.Wrap
+ text: Wallpapers.upscaleError
+ font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 }
+ color: Theme.red
+ }
+
// A Flow, not a Row: a Row overflows its width and clipped the
// last button in a narrow window (AGENTS.md).
Flow {
+ id: actions
+ readonly property string staged: Wallpapers.target === "V" ? Wallpapers.pendingV : Wallpapers.pendingH
+ readonly property bool small: Wallpapers.canUpscale(staged, Wallpapers.target)
width: parent.width
spacing: 8
+ // Rewrite the staged image 4x larger before applying it, when
+ // it is too small for its screen. Two clicks: the first asks
+ // the decider which model suits it and shows the answer, the
+ // second upscales with that model (Wallpapers.decide and
+ // upscaleFile).
+ Tab {
+ readonly property bool decided: Wallpapers.decidedFor === actions.staged
+ readonly property bool busy: Wallpapers.deciding !== "" || Wallpapers.upscaling !== ""
+ visible: actions.small || busy
+ enabled: !busy
+ text: Wallpapers.deciding !== "" ? "deciding…"
+ : Wallpapers.upscaling !== "" ? "upscaling…"
+ : decided ? `Upscale 4× (${Wallpapers.decidedKind})`
+ : "Upscale 4×: pick model"
+ selected: decided && !busy
+ onClicked: decided ? Wallpapers.upscaleFile(actions.staged) : Wallpapers.decide(actions.staged)
+ }
+
// Apply and Reset are in the page header, with every settings
// page's.
// wallhaven-dl searches wallhaven.cc and finds larger