Make the wallpaper picker a full-screen live preview
The screen previews the selected wallpaper with the real transition (TransitionStage, now shared with the desktop background) under a frosted sheet with a 16:9 thumbnail grid. Click or arrows preview, double-click or Enter applies and switches the picker's output directly, Space peeks, typing searches. Thumbnails mark outline wallpapers (wallfx status). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b6d0da4679
commit
de9b863f3f
7 files changed
+469
-204
No files matched your search
@@ -16,7 +16,7 @@ Open Settings → Wallpaper → Open wallpaper picker, or run:
|
|||||||
./scripts/glassmxrph wallpaper
|
./scripts/glassmxrph wallpaper
|
||||||
```
|
```
|
||||||
|
|
||||||
The centered carousel follows the current Super+Shift+W picker's visual concept and runs entirely inside glassMxrph. Search local images, select an output, browse with arrow keys and apply with Enter or double-click. History records the last 50 selections. Escape or an outside click closes it.
|
The picker covers the screen with a live preview of the selected wallpaper and a grid of thumbnails on a frosted sheet. Selecting a wallpaper (click or arrow keys) plays the real transition to it in the preview; Enter or double-click applies it, and the desktop under the preview switches directly while other outputs play the transition. Space hides the sheet to look at the preview alone, typing searches, and Escape closes without changing anything. ✦ marks wallpapers whose subject outline is drawn first. History records the last 50 selections.
|
||||||
|
|
||||||
Configure image directories in Wallpaper settings; the default search directory is ~/Pictures/Wallpapers. Select the Native backend when replacing Serpantinum. New configurations default to Native; existing explicit backend preferences are preserved.
|
Configure image directories in Wallpaper settings; the default search directory is ~/Pictures/Wallpapers. Select the Native backend when replacing Serpantinum. New configurations default to Native; existing explicit backend preferences are preserved.
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ JSON object:
|
|||||||
{"kind": "colonies", "pending": true} when IMG is not
|
{"kind": "colonies", "pending": true} when IMG is not
|
||||||
processed yet, {"kind": "colonies"} when it has no subject.
|
processed yet, {"kind": "colonies"} when it has no subject.
|
||||||
Uses only the standard library, so it answers at once.
|
Uses only the standard library, so it answers at once.
|
||||||
|
status IMG... {IMG: "outline" | "colonies" | "pending"}; standard library only.
|
||||||
warm IMG... processes every image not cached yet; one warm at a time.
|
warm IMG... processes every image not cached yet; one warm at a time.
|
||||||
outline IMG [--force]
|
outline IMG [--force]
|
||||||
|
|
||||||
@@ -225,7 +226,7 @@ def warm(paths):
|
|||||||
|
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
if len(argv) < 2 or argv[0] not in ("choose", "warm", "outline"):
|
if len(argv) < 2 or argv[0] not in ("choose", "status", "warm", "outline"):
|
||||||
print(__doc__, file=sys.stderr)
|
print(__doc__, file=sys.stderr)
|
||||||
return 2
|
return 2
|
||||||
cmd, rest = argv[0], argv[1:]
|
cmd, rest = argv[0], argv[1:]
|
||||||
@@ -238,6 +239,14 @@ def main(argv):
|
|||||||
out = {"kind": "outline", "field": hit[0], "line": hit[1]}
|
out = {"kind": "outline", "field": hit[0], "line": hit[1]}
|
||||||
else:
|
else:
|
||||||
out = {"kind": "colonies", "pending": hit is None and bool(MODEL)}
|
out = {"kind": "colonies", "pending": hit is None and bool(MODEL)}
|
||||||
|
elif cmd == "status":
|
||||||
|
out = {}
|
||||||
|
for path in rest:
|
||||||
|
try:
|
||||||
|
hit = cached(path)
|
||||||
|
except OSError:
|
||||||
|
continue
|
||||||
|
out[path] = "outline" if hit else ("pending" if hit is None else "colonies")
|
||||||
elif not MODEL or not os.path.exists(MODEL):
|
elif not MODEL or not os.path.exists(MODEL):
|
||||||
print("wallfx: GLASSMXRPH_WALLFX_MODEL is not set or missing", file=sys.stderr)
|
print("wallfx: GLASSMXRPH_WALLFX_MODEL is not set or missing", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -48,11 +48,18 @@ Singleton {
|
|||||||
next[output] = path;
|
next[output] = path;
|
||||||
observed = next;
|
observed = next;
|
||||||
}
|
}
|
||||||
function apply(path) {
|
// Output -> path that switches without a change, because the picker's live
|
||||||
|
// preview already shows it there (see WallpaperBackground).
|
||||||
|
property var instant: ({})
|
||||||
|
function apply(path, instantOutput) {
|
||||||
const outputs = selectedMonitor === "all" ? Quickshell.screens.map(s => s.name) : [monitor];
|
const outputs = selectedMonitor === "all" ? Quickshell.screens.map(s => s.name) : [monitor];
|
||||||
if (!ConfigService.ready || !ConfigService.writable || !outputs.length || !outputs[0] || busy)
|
if (!ConfigService.ready || !ConfigService.writable || !outputs.length || !outputs[0] || busy)
|
||||||
return false;
|
return false;
|
||||||
error = "";
|
error = "";
|
||||||
|
const nextInstant = {};
|
||||||
|
if (instantOutput)
|
||||||
|
nextInstant[instantOutput] = path;
|
||||||
|
instant = nextInstant;
|
||||||
prepareTransition(path);
|
prepareTransition(path);
|
||||||
// Native rendering needs no provider round trip: decode once, then switch
|
// Native rendering needs no provider round trip: decode once, then switch
|
||||||
// every output in one write so their transitions start together.
|
// every output in one write so their transitions start together.
|
||||||
@@ -108,6 +115,7 @@ Singleton {
|
|||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
root.images = result.images;
|
root.images = result.images;
|
||||||
root.warmOutlines(result.images.map(image => image.path));
|
root.warmOutlines(result.images.map(image => image.path));
|
||||||
|
root.refreshOutlineStatus();
|
||||||
root.notice = (result.notice || "") + (result.limited ? " Showing the first 1,000 images." : "");
|
root.notice = (result.notice || "") + (result.limited ? " Showing the first 1,000 images." : "");
|
||||||
} else
|
} else
|
||||||
root.error = result.error;
|
root.error = result.error;
|
||||||
@@ -215,6 +223,34 @@ Singleton {
|
|||||||
Process {
|
Process {
|
||||||
id: warmJob
|
id: warmJob
|
||||||
environment: ({LD_LIBRARY_PATH: null})
|
environment: ({LD_LIBRARY_PATH: null})
|
||||||
|
onExited: root.refreshOutlineStatus()
|
||||||
|
}
|
||||||
|
// Path -> "outline", "colonies" or "pending", for the picker's badges.
|
||||||
|
property var outlineStatus: ({})
|
||||||
|
function refreshOutlineStatus() {
|
||||||
|
if (!outlinesAvailable || !images.length)
|
||||||
|
return;
|
||||||
|
if (statusJob.running)
|
||||||
|
return void (statusJob.again = true);
|
||||||
|
statusJob.command = [wallfxPython, Quickshell.shellPath("helpers/wallfx.py"), "status"].concat(images.map(image => image.path));
|
||||||
|
statusJob.running = true;
|
||||||
|
}
|
||||||
|
Process {
|
||||||
|
id: statusJob
|
||||||
|
property bool again: false
|
||||||
|
environment: ({LD_LIBRARY_PATH: null})
|
||||||
|
stdout: StdioCollector {
|
||||||
|
id: statusOutput
|
||||||
|
}
|
||||||
|
onExited: {
|
||||||
|
try {
|
||||||
|
root.outlineStatus = JSON.parse(statusOutput.text);
|
||||||
|
} catch (error) {}
|
||||||
|
if (statusJob.again) {
|
||||||
|
statusJob.again = false;
|
||||||
|
Qt.callLater(root.refreshOutlineStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Native backgrounds report when their new image has decoded; the reveal
|
// Native backgrounds report when their new image has decoded; the reveal
|
||||||
// starts on every output together once all of them are ready.
|
// starts on every output together once all of them are ready.
|
||||||
|
|||||||
@@ -116,10 +116,11 @@ Item {
|
|||||||
}
|
}
|
||||||
function pickerQuery(text: string): void {input.findChild(ShellState.wallpaperWindow.contentItem,"wallpaperSearch").text=text;}
|
function pickerQuery(text: string): void {input.findChild(ShellState.wallpaperWindow.contentItem,"wallpaperSearch").text=text;}
|
||||||
function pickerSelect(index: int): bool {
|
function pickerSelect(index: int): bool {
|
||||||
const view=input.findChild(ShellState.wallpaperWindow.contentItem,"wallpaperCarousel");
|
const view=input.findChild(ShellState.wallpaperWindow.contentItem,"wallpaperGrid");
|
||||||
view.positionViewAtIndex(index,ListView.Contain);input.wait(50);
|
view.positionViewAtIndex(index,GridView.Contain);input.wait(50);
|
||||||
const item=view.itemAtIndex(index);if(!item)return false;
|
const item=view.itemAtIndex(index);if(!item)return false;
|
||||||
input.mouseClick(item,item.width/2,item.height/2);return true;
|
// Click previews; double-click applies.
|
||||||
|
input.mouseDoubleClickSequence(item,item.width/2,item.height/2);return true;
|
||||||
}
|
}
|
||||||
function pickerScreenshot(path: string): bool {return input.findChild(ShellState.wallpaperWindow.contentItem,"wallpaperPickerSurface").grabToImage(result=>result.saveToFile(path));}
|
function pickerScreenshot(path: string): bool {return input.findChild(ShellState.wallpaperWindow.contentItem,"wallpaperPickerSurface").grabToImage(result=>result.saveToFile(path));}
|
||||||
function geometry(name: string): string {
|
function geometry(name: string): string {
|
||||||
|
|||||||
@@ -0,0 +1,175 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQuick
|
||||||
|
import "../services"
|
||||||
|
import "../theme"
|
||||||
|
// A full-size wallpaper that changes with shaders/transition.frag: colonies, or
|
||||||
|
// the new wallpaper's subject outline when helpers/wallfx.py has its maps.
|
||||||
|
// The desktop background and the picker's live preview both draw with it.
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
// The wallpaper to show. Changing it starts a change once the new image
|
||||||
|
// (and its outline maps, if any) are loaded.
|
||||||
|
property string path: ""
|
||||||
|
// false: a change starts as soon as it is ready. true: it emits ready()
|
||||||
|
// and waits for go(), so several outputs can start together.
|
||||||
|
property bool waitForGo: false
|
||||||
|
// Show the next path directly, without a change (consumed by that change).
|
||||||
|
property bool instantNext: false
|
||||||
|
signal loading()
|
||||||
|
signal ready()
|
||||||
|
// 0..1 while the new wallpaper takes over.
|
||||||
|
property real progress: 0
|
||||||
|
readonly property bool transitioning: incoming.source.toString() !== ""
|
||||||
|
readonly property bool running: reveal.running
|
||||||
|
readonly property string target: path ? "file://" + encodeURI(path).replace(/#/g, "%23").replace(/\?/g, "%3F") : ""
|
||||||
|
// The first wallpaper (and reduced motion) appears directly; later changes
|
||||||
|
// load into `incoming` and are revealed once decoded.
|
||||||
|
onTargetChanged: {
|
||||||
|
if (!shown.source.toString() || Theme.duration === 0 || instantNext) {
|
||||||
|
instantNext = false;
|
||||||
|
reveal.stop(); progress = 0; incoming.source = ""; shown.source = target;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Mid-change: land on the wallpaper it was heading to (it is decoded and
|
||||||
|
// cached), then head for the next one from there.
|
||||||
|
if (reveal.running) {
|
||||||
|
reveal.stop();
|
||||||
|
shown.source = incoming.source;
|
||||||
|
}
|
||||||
|
progress = 0;
|
||||||
|
if (target === shown.source.toString()) {
|
||||||
|
incoming.source = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
reported = false;
|
||||||
|
loading();
|
||||||
|
WallpaperService.prepareTransition(path, true);
|
||||||
|
incomingPath = path;
|
||||||
|
incoming.source = target;
|
||||||
|
}
|
||||||
|
Component.onCompleted: shown.source = target
|
||||||
|
function settle() {
|
||||||
|
if (!reveal.running && shown.status === Image.Ready && shown.source.toString() === incoming.source.toString())
|
||||||
|
incoming.source = "";
|
||||||
|
}
|
||||||
|
Image {
|
||||||
|
id: shown
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(root.width, root.height)
|
||||||
|
asynchronous: true
|
||||||
|
retainWhileLoading: true
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
// Drop the overlay only once the base layer shows the new image.
|
||||||
|
onStatusChanged: root.settle()
|
||||||
|
}
|
||||||
|
// The incoming image and the outline maps are only textures: the shader
|
||||||
|
// draws the change over `shown`.
|
||||||
|
Image {
|
||||||
|
id: incoming
|
||||||
|
visible: false
|
||||||
|
sourceSize: Qt.size(root.width, root.height)
|
||||||
|
asynchronous: true
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
onStatusChanged: {
|
||||||
|
if (status === Image.Error)
|
||||||
|
incoming.source = "";
|
||||||
|
else
|
||||||
|
root.reportIfReady();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// The outline plan for the incoming wallpaper (WallpaperService), once known.
|
||||||
|
property string incomingPath: ""
|
||||||
|
readonly property var plan: root.transitioning ? WallpaperService.transitions[root.incomingPath] : undefined
|
||||||
|
readonly property bool wantsOutline: !!root.plan && root.plan.kind === "outline"
|
||||||
|
readonly property bool outlineReady: root.wantsOutline && fieldMap.status === Image.Ready && lineMap.status === Image.Ready
|
||||||
|
// Settled: colonies, outline maps loaded, or maps that failed (colonies then).
|
||||||
|
readonly property bool planSettled: root.plan !== undefined && (!root.wantsOutline || root.outlineReady
|
||||||
|
|| fieldMap.status === Image.Error || lineMap.status === Image.Error)
|
||||||
|
onPlanSettledChanged: reportIfReady()
|
||||||
|
property bool reported: false
|
||||||
|
function reportIfReady() {
|
||||||
|
if (reported || incoming.status !== Image.Ready || !incoming.source.toString() || !planSettled)
|
||||||
|
return;
|
||||||
|
reported = true;
|
||||||
|
ready();
|
||||||
|
if (!waitForGo)
|
||||||
|
go();
|
||||||
|
}
|
||||||
|
// Starts the change if the new image is decoded. Without a settled plan
|
||||||
|
// (the owner's fallback fired first) it uses colonies.
|
||||||
|
function go() {
|
||||||
|
if (incoming.status !== Image.Ready || !incoming.source.toString() || reveal.running || progress !== 0)
|
||||||
|
return;
|
||||||
|
seed = Math.random() * 100;
|
||||||
|
ember = Theme.accentVivid;
|
||||||
|
mode = outlineReady ? 1 : 0;
|
||||||
|
reveal.duration = mode ? 2000 : 1800;
|
||||||
|
reveal.restart();
|
||||||
|
}
|
||||||
|
// Maps hold numbers, not colours, at their own size; the shader interpolates.
|
||||||
|
Image {
|
||||||
|
id: fieldMap
|
||||||
|
visible: false
|
||||||
|
asynchronous: true
|
||||||
|
cache: false
|
||||||
|
source: root.wantsOutline ? "file://" + root.plan.field : ""
|
||||||
|
}
|
||||||
|
Image {
|
||||||
|
id: lineMap
|
||||||
|
visible: false
|
||||||
|
asynchronous: true
|
||||||
|
cache: false
|
||||||
|
source: root.wantsOutline ? "file://" + root.plan.line : ""
|
||||||
|
}
|
||||||
|
// PreserveAspectCrop decodes to cover the item, so the texture can be
|
||||||
|
// larger than the item on one axis: sample its centred window.
|
||||||
|
function crop(img) {
|
||||||
|
const iw = Math.max(img.implicitWidth, 1), ih = Math.max(img.implicitHeight, 1);
|
||||||
|
const s = Math.max(root.width / iw, root.height / ih);
|
||||||
|
const w = root.width / (iw * s), h = root.height / (ih * s);
|
||||||
|
return Qt.vector4d((1 - w) / 2, (1 - h) / 2, w, h);
|
||||||
|
}
|
||||||
|
ShaderEffect {
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: root.transitioning && incoming.status === Image.Ready && root.progress > 0
|
||||||
|
property var oldTex: shown
|
||||||
|
property var newTex: incoming
|
||||||
|
property real t: root.progress
|
||||||
|
property real sw: width
|
||||||
|
property real sh: height
|
||||||
|
property real cell: 4
|
||||||
|
property real glow: 0.9
|
||||||
|
property real seed: root.seed
|
||||||
|
property vector4d cropOld: root.crop(shown)
|
||||||
|
property vector4d cropNew: root.crop(incoming)
|
||||||
|
property color ember: root.ember
|
||||||
|
property color ink: Theme.text
|
||||||
|
property real mode: root.mode
|
||||||
|
// Unused in colonies mode, but every sampler needs a texture.
|
||||||
|
property var fieldTex: root.outlineReady ? fieldMap : incoming
|
||||||
|
property var lineTex: root.outlineReady ? lineMap : incoming
|
||||||
|
property real fw: Math.max(fieldMap.implicitWidth, 1)
|
||||||
|
property real fh: Math.max(fieldMap.implicitHeight, 1)
|
||||||
|
property real lineW: 1.5
|
||||||
|
property real sdRange: 16
|
||||||
|
fragmentShader: Qt.resolvedUrl("shaders/transition.frag.qsb")
|
||||||
|
}
|
||||||
|
// Captured when a change starts, so the burn keeps its colour even if the
|
||||||
|
// palette regenerates from the new wallpaper halfway through.
|
||||||
|
property real seed: 0
|
||||||
|
property color ember: Theme.accentVivid
|
||||||
|
property real mode: 0
|
||||||
|
NumberAnimation {
|
||||||
|
id: reveal
|
||||||
|
target: root
|
||||||
|
property: "progress"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
// Linear time: the shader eases its own phases. Set per change.
|
||||||
|
easing.type: Easing.Linear
|
||||||
|
onFinished: {
|
||||||
|
shown.source = incoming.source;
|
||||||
|
Qt.callLater(root.settle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,137 +16,23 @@ PanelWindow {
|
|||||||
WlrLayershell.namespace:"glassMxrph-wallpaper"
|
WlrLayershell.namespace:"glassMxrph-wallpaper"
|
||||||
mask:Region {}
|
mask:Region {}
|
||||||
readonly property string targetPath:ConfigService.ready ? (ConfigService.data.wallpaper.byMonitor[root.modelData.name] || "") : ""
|
readonly property string targetPath:ConfigService.ready ? (ConfigService.data.wallpaper.byMonitor[root.modelData.name] || "") : ""
|
||||||
readonly property string target:targetPath ? "file://"+encodeURI(targetPath).replace(/#/g,"%23").replace(/\?/g,"%3F") : ""
|
TransitionStage {
|
||||||
// 0..1 while the new wallpaper takes over (shaders/transition.frag).
|
id:stage
|
||||||
property real progress:0
|
|
||||||
readonly property bool transitioning:incoming.source.toString()!==""
|
|
||||||
// The first wallpaper (and reduced motion) appears directly; later changes
|
|
||||||
// load into `incoming` and are revealed once decoded.
|
|
||||||
onTargetChanged:{
|
|
||||||
if(!shown.source.toString() || Theme.duration===0) {reveal.stop();incoming.source="";shown.source=target;}
|
|
||||||
else if(target===shown.source.toString()) {reveal.stop();incoming.source="";}
|
|
||||||
else {
|
|
||||||
reveal.stop();progress=0;reported=false;
|
|
||||||
WallpaperService.revealLoading(modelData.name);
|
|
||||||
WallpaperService.prepareTransition(targetPath,true);
|
|
||||||
incomingPath=targetPath;incoming.source=target;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted:shown.source=target
|
|
||||||
function settle() {
|
|
||||||
if(!reveal.running && shown.status===Image.Ready && shown.source.toString()===incoming.source.toString())incoming.source="";
|
|
||||||
}
|
|
||||||
Image {
|
|
||||||
id:shown
|
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
sourceSize:Qt.size(parent.width,parent.height)
|
// Every output starts its change together (WallpaperService.revealSerial).
|
||||||
asynchronous:true
|
waitForGo:true
|
||||||
retainWhileLoading:true
|
onLoading:WallpaperService.revealLoading(root.modelData.name)
|
||||||
fillMode:Image.PreserveAspectCrop
|
onReady:WallpaperService.revealReady(root.modelData.name)
|
||||||
// Drop the overlay only once the base layer shows the new image.
|
|
||||||
onStatusChanged:root.settle()
|
|
||||||
}
|
}
|
||||||
// The incoming image and the outline maps are only textures: the shader
|
// The picker's live preview already shows the wallpaper it applies on its
|
||||||
// draws the change over `shown`.
|
// own output, so that output switches directly underneath it.
|
||||||
Image {
|
onTargetPathChanged:{
|
||||||
id:incoming
|
stage.instantNext=WallpaperService.instant[root.modelData.name]===targetPath;
|
||||||
visible:false
|
stage.path=targetPath;
|
||||||
sourceSize:Qt.size(root.width,root.height)
|
|
||||||
asynchronous:true
|
|
||||||
fillMode:Image.PreserveAspectCrop
|
|
||||||
onStatusChanged:{
|
|
||||||
if(status===Image.Error)incoming.source="";
|
|
||||||
else root.reportIfReady();
|
|
||||||
}
|
}
|
||||||
}
|
Component.onCompleted:stage.path=targetPath
|
||||||
// The outline plan for the incoming wallpaper (WallpaperService), once known.
|
|
||||||
property string incomingPath:""
|
|
||||||
readonly property var plan:root.transitioning ? WallpaperService.transitions[root.incomingPath] : undefined
|
|
||||||
readonly property bool wantsOutline:!!root.plan && root.plan.kind==="outline"
|
|
||||||
readonly property bool outlineReady:root.wantsOutline && fieldMap.status===Image.Ready && lineMap.status===Image.Ready
|
|
||||||
// Settled: colonies, outline maps loaded, or maps that failed (colonies then).
|
|
||||||
readonly property bool planSettled:root.plan!==undefined && (!root.wantsOutline || root.outlineReady
|
|
||||||
|| fieldMap.status===Image.Error || lineMap.status===Image.Error)
|
|
||||||
onPlanSettledChanged:reportIfReady()
|
|
||||||
property bool reported:false
|
|
||||||
// Ready once the image is decoded and the plan settled. The service's
|
|
||||||
// fallback starts the change anyway if this takes too long; it then uses
|
|
||||||
// colonies unless the maps happen to be in.
|
|
||||||
function reportIfReady() {
|
|
||||||
if(reported || incoming.status!==Image.Ready || !incoming.source.toString() || !planSettled)return;
|
|
||||||
reported=true;
|
|
||||||
WallpaperService.revealReady(root.modelData.name);
|
|
||||||
}
|
|
||||||
// Maps hold numbers, not colours, at their own size; the shader interpolates.
|
|
||||||
Image {
|
|
||||||
id:fieldMap
|
|
||||||
visible:false
|
|
||||||
asynchronous:true
|
|
||||||
cache:false
|
|
||||||
source:root.wantsOutline ? "file://"+root.plan.field : ""
|
|
||||||
}
|
|
||||||
Image {
|
|
||||||
id:lineMap
|
|
||||||
visible:false
|
|
||||||
asynchronous:true
|
|
||||||
cache:false
|
|
||||||
source:root.wantsOutline ? "file://"+root.plan.line : ""
|
|
||||||
}
|
|
||||||
// PreserveAspectCrop decodes to cover the output, so the texture can be
|
|
||||||
// larger than the item on one axis: sample its centred window.
|
|
||||||
function crop(img) {
|
|
||||||
const iw=Math.max(img.implicitWidth,1),ih=Math.max(img.implicitHeight,1);
|
|
||||||
const s=Math.max(root.width/iw,root.height/ih);
|
|
||||||
const w=root.width/(iw*s),h=root.height/(ih*s);
|
|
||||||
return Qt.vector4d((1-w)/2,(1-h)/2,w,h);
|
|
||||||
}
|
|
||||||
ShaderEffect {
|
|
||||||
anchors.fill:parent
|
|
||||||
visible:root.transitioning && incoming.status===Image.Ready && root.progress>0
|
|
||||||
property var oldTex:shown
|
|
||||||
property var newTex:incoming
|
|
||||||
property real t:root.progress
|
|
||||||
property real sw:width
|
|
||||||
property real sh:height
|
|
||||||
property real cell:4
|
|
||||||
property real glow:0.9
|
|
||||||
property real seed:root.seed
|
|
||||||
property vector4d cropOld:root.crop(shown)
|
|
||||||
property vector4d cropNew:root.crop(incoming)
|
|
||||||
property color ember:root.ember
|
|
||||||
property color ink:Theme.text
|
|
||||||
property real mode:root.mode
|
|
||||||
// Unused in colonies mode, but every sampler needs a texture.
|
|
||||||
property var fieldTex:root.outlineReady ? fieldMap : incoming
|
|
||||||
property var lineTex:root.outlineReady ? lineMap : incoming
|
|
||||||
property real fw:Math.max(fieldMap.implicitWidth,1)
|
|
||||||
property real fh:Math.max(fieldMap.implicitHeight,1)
|
|
||||||
property real lineW:1.5
|
|
||||||
property real sdRange:16
|
|
||||||
fragmentShader:Qt.resolvedUrl("shaders/transition.frag.qsb")
|
|
||||||
}
|
|
||||||
// Captured when a change starts, so the burn keeps its colour even if the
|
|
||||||
// palette regenerates from the new wallpaper halfway through.
|
|
||||||
property real seed:0
|
|
||||||
property color ember:Theme.accentVivid
|
|
||||||
property real mode:0
|
|
||||||
Connections {
|
Connections {
|
||||||
target:WallpaperService
|
target:WallpaperService
|
||||||
function onRevealSerialChanged() {
|
function onRevealSerialChanged() {stage.go();}
|
||||||
if(incoming.status===Image.Ready && incoming.source.toString() && !reveal.running && root.progress===0) {
|
|
||||||
root.seed=Math.random()*100;root.ember=Theme.accentVivid;
|
|
||||||
root.mode=root.outlineReady ? 1 : 0;
|
|
||||||
reveal.duration=root.mode ? 2000 : 1800;
|
|
||||||
reveal.restart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
id:reveal
|
|
||||||
target:root;property:"progress"
|
|
||||||
from:0;to:1
|
|
||||||
// Linear time: the shader eases its own phases. Set per change.
|
|
||||||
easing.type:Easing.Linear
|
|
||||||
onFinished:{shown.source=incoming.source;Qt.callLater(root.settle);}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Effects
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
@@ -9,115 +10,272 @@ import "../services"
|
|||||||
import "../core"
|
import "../core"
|
||||||
import "../theme"
|
import "../theme"
|
||||||
// qmllint disable uncreatable-type
|
// qmllint disable uncreatable-type
|
||||||
|
// Full-screen wallpaper picker. The whole screen is a live preview: moving the
|
||||||
|
// selection plays the real change (TransitionStage) to that wallpaper, and the
|
||||||
|
// grid sits on a frosted sheet over it. Enter applies (the desktop under the
|
||||||
|
// preview switches directly, see WallpaperBackground), Esc leaves everything as
|
||||||
|
// it was, Space hides the sheet to look at the preview alone.
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id:root
|
id:root
|
||||||
screen:ScreenService.current(ShellState.wallpaperScreen)
|
screen:ScreenService.current(ShellState.wallpaperScreen)
|
||||||
// Hangs from the middle of the bar as a drawer; the layer starts at the
|
anchors {top:true;bottom:true;left:true;right:true}
|
||||||
// screen top so the bar join is inside its box.
|
readonly property string screenName:screen ? screen.name : ""
|
||||||
anchors {top:true}
|
readonly property bool open:ShellState.wallpaperPickerOpen
|
||||||
readonly property real screenWidth:screen ? screen.width : 1920
|
visible:open || content.opacity>0
|
||||||
readonly property real screenHeight:screen ? screen.height : 1080
|
|
||||||
implicitWidth:Math.round(surface.width)
|
|
||||||
implicitHeight:Math.round(BarDrawers.bottom+surface.contentHeight)
|
|
||||||
visible:ShellState.wallpaperPickerOpen || surface.shown
|
|
||||||
color:Theme.transparent
|
color:Theme.transparent
|
||||||
exclusionMode:ExclusionMode.Ignore
|
exclusionMode:ExclusionMode.Ignore
|
||||||
WlrLayershell.namespace:"glassMxrph-wallpaper-picker"
|
WlrLayershell.namespace:"glassMxrph-wallpaper-picker"
|
||||||
WlrLayershell.layer:WlrLayer.Overlay
|
WlrLayershell.layer:WlrLayer.Overlay
|
||||||
WlrLayershell.keyboardFocus:ShellState.wallpaperPickerOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus:open ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||||
Component.onCompleted:ShellState.wallpaperWindow=root
|
Component.onCompleted:ShellState.wallpaperWindow=root
|
||||||
Component.onDestruction:ShellState.wallpaperWindow=null
|
Component.onDestruction:ShellState.wallpaperWindow=null
|
||||||
|
|
||||||
property string filter:"all"
|
property string filter:"all"
|
||||||
readonly property var results:WallpaperService.images.filter(i=>(filter!=="history" || ConfigService.data.wallpaper.history.includes(i.path)) && (!search.text || i.name.toLowerCase().includes(search.text.toLowerCase())))
|
readonly property var results:WallpaperService.images.filter(i=>(filter!=="history" || ConfigService.data.wallpaper.history.includes(i.path)) && (!search.text || i.name.toLowerCase().includes(search.text.toLowerCase())))
|
||||||
// A vertical mouse wheel steps through the horizontal strip, one tile per notch.
|
// The selection lives here, not in the view: a rescan or a new search
|
||||||
// Handled on the tiles: their MouseAreas take wheel events before the ListView.
|
// replaces the model, and the view would fall back to the first tile.
|
||||||
property real wheelPending:0
|
property string selectedPath:""
|
||||||
function wheelStep(event) {
|
readonly property var selected:results.find(i=>i.path===selectedPath) || null
|
||||||
wheelPending+=event.angleDelta.y || event.angleDelta.x;
|
property bool peek:false
|
||||||
const steps=Math.trunc(wheelPending/120);
|
property string applying:""
|
||||||
if(!steps)return;
|
readonly property string desktopPath:ConfigService.ready ? (ConfigService.data.wallpaper.byMonitor[root.screenName] || WallpaperService.currentPath) : ""
|
||||||
wheelPending-=steps*120;
|
|
||||||
view.currentIndex=Math.max(0,Math.min(view.count-1,view.currentIndex-steps));
|
function select(index) {
|
||||||
|
if(index<0 || index>=results.length)return;
|
||||||
|
view.currentIndex=index;
|
||||||
|
selectedPath=results[index].path;
|
||||||
}
|
}
|
||||||
function applyCurrent() {if(root.results[view.currentIndex])WallpaperService.apply(root.results[view.currentIndex].path);}
|
function syncSelection() {
|
||||||
Connections {
|
const index=results.findIndex(i=>i.path===selectedPath);
|
||||||
target:ShellState
|
if(index>=0)view.currentIndex=index;
|
||||||
function onWallpaperPickerOpenChanged() {
|
else if(results.length)select(0);
|
||||||
if(ShellState.wallpaperPickerOpen) {
|
}
|
||||||
|
onResultsChanged:Qt.callLater(syncSelection)
|
||||||
|
// Previews follow the selection once it rests, so sweeping across the grid
|
||||||
|
// does not start a change per tile.
|
||||||
|
onSelectedPathChanged:previewDelay.restart()
|
||||||
|
Timer {id:previewDelay;interval:200;onTriggered:if(root.open && root.selectedPath)preview.path=root.selectedPath}
|
||||||
|
|
||||||
|
function applySelected() {
|
||||||
|
if(!selectedPath || applying)return;
|
||||||
|
// Enter before the preview caught up: show it directly, the desktop is about to.
|
||||||
|
if(preview.path!==selectedPath) {previewDelay.stop();preview.instantNext=true;preview.path=selectedPath;}
|
||||||
|
if(WallpaperService.apply(selectedPath,root.screenName)) {applying=selectedPath;applyGuard.restart();}
|
||||||
|
}
|
||||||
|
// Close once this output's desktop shows the applied wallpaper (a moment to
|
||||||
|
// decode it), or after a while regardless.
|
||||||
|
readonly property bool applied:applying!=="" && desktopPath===applying
|
||||||
|
onAppliedChanged:if(applied)closeDelay.restart()
|
||||||
|
Timer {id:closeDelay;interval:150;onTriggered:root.close()}
|
||||||
|
Timer {id:applyGuard;interval:1500;onTriggered:if(root.applying)root.close()}
|
||||||
|
function close() {applying="";ShellState.wallpaperPickerOpen=false;}
|
||||||
|
|
||||||
|
onOpenChanged:{
|
||||||
|
if(open) {
|
||||||
|
applying="";peek=false;
|
||||||
WallpaperService.refresh();WallpaperService.scan();
|
WallpaperService.refresh();WallpaperService.scan();
|
||||||
|
preview.instantNext=true;
|
||||||
|
preview.path=desktopPath;
|
||||||
|
selectedPath=desktopPath;
|
||||||
|
syncSelection();
|
||||||
|
view.positionViewAtIndex(Math.max(0,view.currentIndex),GridView.Center);
|
||||||
Qt.callLater(()=>view.forceActiveFocus());
|
Qt.callLater(()=>view.forceActiveFocus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Exclusive focus routes outside clicks here (see ControlCenter).
|
Item {
|
||||||
MouseArea {x:-20000;y:-20000;width:40000;height:40000;onPressed:ShellState.wallpaperPickerOpen=false}
|
id:content
|
||||||
BarDrawer {
|
|
||||||
id:surface
|
|
||||||
objectName:"wallpaperPickerSurface"
|
objectName:"wallpaperPickerSurface"
|
||||||
y:BarDrawers.bottom
|
anchors.fill:parent
|
||||||
open:ShellState.wallpaperPickerOpen
|
opacity:root.open ? 1 : 0
|
||||||
contentWidth:Math.min(1240,root.screenWidth-2*(BarDrawers.margin+BarDrawers.radius+ear))
|
Behavior on opacity {NumberAnimation {duration:Theme.duration*1.2;easing.type:Easing.OutCubic}}
|
||||||
contentHeight:Math.min(590,root.screenHeight-BarDrawers.bottom-40)
|
// Release the preview's textures once fully closed.
|
||||||
drawerId:"wallpaper"
|
onOpacityChanged:if(opacity===0 && !root.open)preview.path=""
|
||||||
screenName:root.screen ? root.screen.name : ""
|
|
||||||
screenX:(root.screenWidth-width)/2
|
TransitionStage {
|
||||||
MouseArea {anchors.fill:parent}
|
id:preview
|
||||||
|
anchors.fill:parent
|
||||||
|
}
|
||||||
|
MouseArea {anchors.fill:parent;onClicked:root.peek=!root.peek}
|
||||||
|
|
||||||
|
// Name and transition of the selection, over the preview.
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill:parent;anchors.margins:22;spacing:18
|
id:info
|
||||||
|
x:56;y:48
|
||||||
|
spacing:6
|
||||||
|
opacity:root.selected ? 1 : 0
|
||||||
|
Behavior on opacity {NumberAnimation {duration:Theme.duration}}
|
||||||
|
layer.enabled:true
|
||||||
|
layer.effect:MultiEffect {shadowEnabled:true;shadowBlur:0.8;shadowOpacity:0.7;shadowColor:"black";autoPaddingEnabled:true}
|
||||||
|
Text {
|
||||||
|
text:root.selected ? root.selected.name.replace(/\.[^.]+$/,"") : ""
|
||||||
|
color:"white";font.pixelSize:34;font.weight:Font.DemiBold
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
readonly property string status:root.selected ? (WallpaperService.outlineStatus[root.selected.path] || "") : ""
|
||||||
|
text:(status==="outline" ? "✦ Outline transition" : status==="pending" ? "Preparing outline…" : "Colonies transition")
|
||||||
|
+" · "+(view.currentIndex+1)+" / "+root.results.length
|
||||||
|
+(root.selected && root.selected.path===root.desktopPath ? " · current" : "")
|
||||||
|
color:Qt.alpha("white",0.85);font.pixelSize:15
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Frosted sheet: a blurred copy of the preview behind it, so the glass
|
||||||
|
// shows the wallpaper being previewed (the compositor's blur would show
|
||||||
|
// what is under this window instead).
|
||||||
|
Item {
|
||||||
|
id:sheet
|
||||||
|
width:parent.width-96
|
||||||
|
height:Math.min(540,Math.round(parent.height*0.46))
|
||||||
|
x:48
|
||||||
|
y:root.peek || !root.open ? parent.height+16 : parent.height-height-36
|
||||||
|
Behavior on y {NumberAnimation {duration:Theme.duration*1.4;easing.type:Easing.OutCubic}}
|
||||||
|
ShaderEffectSource {
|
||||||
|
id:sheetBackdrop
|
||||||
|
sourceItem:preview
|
||||||
|
sourceRect:Qt.rect(sheet.x,sheet.y,sheet.width,sheet.height)
|
||||||
|
visible:false
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
id:sheetMask
|
||||||
|
anchors.fill:parent
|
||||||
|
visible:false
|
||||||
|
layer.enabled:true
|
||||||
|
Rectangle {anchors.fill:parent;radius:28}
|
||||||
|
}
|
||||||
|
MultiEffect {
|
||||||
|
anchors.fill:parent
|
||||||
|
source:sheetBackdrop
|
||||||
|
autoPaddingEnabled:false
|
||||||
|
blurEnabled:true;blur:1;blurMax:64
|
||||||
|
saturation:-0.1;brightness:-0.08
|
||||||
|
maskEnabled:true;maskSource:sheetMask
|
||||||
|
maskThresholdMin:0.5;maskSpreadAtMin:1
|
||||||
|
}
|
||||||
|
Rectangle {anchors.fill:parent;radius:28;color:Qt.alpha(Theme.tint,0.38);border.width:1;border.color:Theme.border}
|
||||||
|
MouseArea {anchors.fill:parent}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.fill:parent;anchors.margins:22;spacing:14
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth:true
|
Layout.fillWidth:true;spacing:10
|
||||||
Text {text:"Wallpapers";color:Theme.text;font.pixelSize:24;Layout.fillWidth:true}
|
Text {text:"Wallpapers";color:Theme.text;font.pixelSize:22}
|
||||||
|
GlassButton {text:"All";accented:root.filter==="all";onClicked:root.filter="all"}
|
||||||
|
GlassButton {text:"History";accented:root.filter==="history";onClicked:root.filter="history"}
|
||||||
|
GlassTextField {
|
||||||
|
id:search;objectName:"wallpaperSearch"
|
||||||
|
Layout.fillWidth:true;placeholderText:"Search wallpapers…"
|
||||||
|
Keys.onEscapePressed:root.close()
|
||||||
|
Keys.onDownPressed:view.forceActiveFocus()
|
||||||
|
Keys.onReturnPressed:view.forceActiveFocus()
|
||||||
|
}
|
||||||
GlassComboBox {
|
GlassComboBox {
|
||||||
Layout.preferredWidth:160
|
Layout.preferredWidth:150
|
||||||
model:["all","primary"].concat(Quickshell.screens.map(s=>s.name))
|
model:["all","primary"].concat(Quickshell.screens.map(s=>s.name))
|
||||||
currentIndex:Math.max(0,model.indexOf(WallpaperService.selectedMonitor))
|
currentIndex:Math.max(0,model.indexOf(WallpaperService.selectedMonitor))
|
||||||
onActivated:WallpaperService.selectedMonitor=currentText
|
onActivated:WallpaperService.selectedMonitor=currentText
|
||||||
}
|
}
|
||||||
GlassIconButton {text:"⚙";onClicked:ShellState.openSettings("wallpaper");Accessible.name:"Wallpaper settings"}
|
|
||||||
GlassIconButton {text:"×";onClicked:ShellState.wallpaperPickerOpen=false;Accessible.name:"Close picker"}
|
|
||||||
}
|
|
||||||
RowLayout {
|
|
||||||
GlassButton {text:"All";accented:root.filter==="all";onClicked:root.filter="all"}
|
|
||||||
GlassButton {text:"History";accented:root.filter==="history";onClicked:root.filter="history"}
|
|
||||||
GlassTextField {id:search;objectName:"wallpaperSearch";Layout.fillWidth:true;placeholderText:"Search wallpapers…";onTextChanged:view.currentIndex=0;Keys.onEscapePressed:ShellState.wallpaperPickerOpen=false;Keys.onDownPressed:view.forceActiveFocus()}
|
|
||||||
GlassIconButton {text:"↻";onClicked:WallpaperService.scan();Accessible.name:"Refresh wallpapers"}
|
GlassIconButton {text:"↻";onClicked:WallpaperService.scan();Accessible.name:"Refresh wallpapers"}
|
||||||
|
GlassIconButton {text:"⚙";onClicked:ShellState.openSettings("wallpaper");Accessible.name:"Wallpaper settings"}
|
||||||
|
GlassIconButton {text:"×";onClicked:root.close();Accessible.name:"Close picker"}
|
||||||
}
|
}
|
||||||
ListView {
|
GridView {
|
||||||
id:view
|
id:view
|
||||||
objectName:"wallpaperCarousel"
|
objectName:"wallpaperGrid"
|
||||||
Layout.fillWidth:true;Layout.fillHeight:true
|
Layout.fillWidth:true;Layout.fillHeight:true
|
||||||
orientation:ListView.Horizontal
|
readonly property int columns:Math.max(3,Math.floor(width/300))
|
||||||
spacing:14
|
cellWidth:Math.floor(width/columns)
|
||||||
|
cellHeight:Math.round((cellWidth-16)*9/16)+16
|
||||||
clip:true
|
clip:true
|
||||||
model:root.results
|
model:root.results
|
||||||
snapMode:ListView.SnapToItem
|
|
||||||
boundsBehavior:Flickable.StopAtBounds
|
boundsBehavior:Flickable.StopAtBounds
|
||||||
highlightMoveDuration:Theme.duration
|
|
||||||
preferredHighlightBegin:width/2-125
|
|
||||||
preferredHighlightEnd:width/2+125
|
|
||||||
highlightRangeMode:ListView.ApplyRange
|
|
||||||
keyNavigationEnabled:true
|
keyNavigationEnabled:true
|
||||||
ScrollBar.horizontal:ScrollBar {}
|
ScrollBar.vertical:ScrollBar {}
|
||||||
Keys.onReturnPressed:root.applyCurrent()
|
onCurrentIndexChanged:if(root.results[currentIndex])root.selectedPath=root.results[currentIndex].path
|
||||||
Keys.onEnterPressed:root.applyCurrent()
|
Keys.onReturnPressed:root.applySelected()
|
||||||
Keys.onEscapePressed:ShellState.wallpaperPickerOpen=false
|
Keys.onEnterPressed:root.applySelected()
|
||||||
delegate:GlassPanel {
|
Keys.onEscapePressed:root.close()
|
||||||
id:tile
|
Keys.onSpacePressed:root.peek=!root.peek
|
||||||
|
// Typing goes to the search field.
|
||||||
|
Keys.onPressed:event=>{
|
||||||
|
if(event.text && event.text.trim() && !(event.modifiers&(Qt.ControlModifier|Qt.AltModifier|Qt.MetaModifier))) {
|
||||||
|
search.forceActiveFocus();search.text+=event.text;event.accepted=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// One rounded mask shared by every thumbnail (they are all the same size).
|
||||||
|
Item {
|
||||||
|
id:tileMask
|
||||||
|
width:view.cellWidth-16;height:view.cellHeight-16
|
||||||
|
visible:false
|
||||||
|
layer.enabled:true
|
||||||
|
Rectangle {anchors.fill:parent;radius:14}
|
||||||
|
}
|
||||||
|
delegate:Item {
|
||||||
|
id:cell
|
||||||
required property var modelData
|
required property var modelData
|
||||||
required property int index
|
required property int index
|
||||||
width:250;height:view.height-10
|
readonly property bool current:view.currentIndex===index
|
||||||
radius:18
|
width:view.cellWidth;height:view.cellHeight
|
||||||
border.width:2
|
Item {
|
||||||
border.color:view.currentIndex===index ? Theme.accent : Theme.border
|
anchors.fill:parent;anchors.margins:8
|
||||||
Image {anchors.fill:parent;anchors.margins:6;source:tile.modelData.url;sourceSize:Qt.size(500,700);asynchronous:true;fillMode:Image.PreserveAspectCrop;clip:true}
|
scale:cell.current ? 1 : (tileArea.containsMouse ? 0.98 : 0.95)
|
||||||
Rectangle {anchors.bottom:parent.bottom;anchors.left:parent.left;anchors.right:parent.right;anchors.margins:6;height:42;color:Qt.alpha(Theme.surface,0.85)
|
Behavior on scale {NumberAnimation {duration:Theme.duration;easing.type:Easing.OutCubic}}
|
||||||
Text {anchors.fill:parent;anchors.margins:10;text:(WallpaperService.currentPath===tile.modelData.path?"✓ ":"")+tile.modelData.name;color:Theme.text;elide:Text.ElideMiddle}
|
Image {
|
||||||
|
anchors.fill:parent
|
||||||
|
source:cell.modelData.url
|
||||||
|
sourceSize:Qt.size(480,270)
|
||||||
|
asynchronous:true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
opacity:status===Image.Ready ? (cell.current ? 1 : 0.82) : 0
|
||||||
|
Behavior on opacity {NumberAnimation {duration:Theme.duration}}
|
||||||
|
layer.enabled:true
|
||||||
|
layer.effect:MultiEffect {maskEnabled:true;maskSource:tileMask;maskThresholdMin:0.5;maskSpreadAtMin:1}
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill:parent;radius:14;color:"transparent"
|
||||||
|
border.width:cell.current ? 3 : 1
|
||||||
|
border.color:cell.current ? Theme.accent : Qt.alpha("white",0.16)
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
anchors.top:parent.top;anchors.right:parent.right;anchors.margins:8;spacing:6
|
||||||
|
Repeater {
|
||||||
|
model:[WallpaperService.outlineStatus[cell.modelData.path]==="outline" ? "✦" : "",
|
||||||
|
cell.modelData.path===root.desktopPath ? "✓" : ""].filter(s=>s)
|
||||||
|
delegate:Rectangle {
|
||||||
|
required property string modelData
|
||||||
|
width:24;height:24;radius:12
|
||||||
|
color:Qt.alpha("black",0.55)
|
||||||
|
Text {anchors.centerIn:parent;text:parent.modelData;color:"white";font.pixelSize:13}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Click previews, double-click applies.
|
||||||
|
MouseArea {
|
||||||
|
id:tileArea
|
||||||
|
anchors.fill:parent
|
||||||
|
hoverEnabled:true
|
||||||
|
onClicked:{root.select(cell.index);view.forceActiveFocus();}
|
||||||
|
onDoubleClicked:{root.select(cell.index);root.applySelected();}
|
||||||
}
|
}
|
||||||
MouseArea {anchors.fill:parent;onClicked:{view.currentIndex=tile.index;view.forceActiveFocus();WallpaperService.apply(tile.modelData.path);}onWheel:event=>root.wheelStep(event)}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text {visible:!root.results.length;text:WallpaperService.scanning ? "Loading wallpapers…" : "No wallpapers here. Choose a folder in Wallpaper settings.";color:Theme.textSecondary;Layout.fillWidth:true;wrapMode:Text.Wrap}
|
Text {visible:!root.results.length;text:WallpaperService.scanning ? "Loading wallpapers…" : "No wallpapers here. Choose a folder in Wallpaper settings.";color:Theme.textSecondary;Layout.fillWidth:true;wrapMode:Text.Wrap}
|
||||||
Text {text:WallpaperService.error || (WallpaperService.busy?"Applying wallpaper…":"Click or ← → and Enter to apply · Esc Close");color:WallpaperService.error?Theme.urgent:Theme.textSecondary;Layout.fillWidth:true;wrapMode:Text.Wrap}
|
Text {
|
||||||
|
text:WallpaperService.error || (root.applying ? "Applying wallpaper…" : "Click or arrows preview · Double-click or Enter apply · Space peek · type to search · Esc close")
|
||||||
|
color:WallpaperService.error ? Theme.urgent : Theme.textSecondary
|
||||||
|
Layout.fillWidth:true;elide:Text.ElideRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// While peeking, a click or any key brings the sheet back.
|
||||||
|
Text {
|
||||||
|
anchors.bottom:parent.bottom;anchors.horizontalCenter:parent.horizontalCenter;anchors.bottomMargin:28
|
||||||
|
visible:root.peek && root.open
|
||||||
|
text:"Space to show wallpapers · Enter apply · Esc close"
|
||||||
|
color:"white";font.pixelSize:14
|
||||||
|
layer.enabled:true
|
||||||
|
layer.effect:MultiEffect {shadowEnabled:true;shadowBlur:0.6;shadowOpacity:0.8;shadowColor:"black"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user