2026-03-11 14:14:04 +01:00
|
|
|
pragma ComponentBehavior: Bound
|
|
|
|
|
import Quickshell
|
|
|
|
|
import Quickshell.Hyprland
|
|
|
|
|
import Quickshell.Io
|
|
|
|
|
import QtQuick
|
|
|
|
|
import Qt.labs.folderlistmodel 2.10
|
|
|
|
|
import qs
|
|
|
|
|
import qs.settings
|
|
|
|
|
|
2026-03-20 11:41:56 +01:00
|
|
|
Loader {
|
|
|
|
|
active: Settings.config.wallswitchershown
|
|
|
|
|
sourceComponent: root
|
|
|
|
|
Component {
|
|
|
|
|
id: root
|
|
|
|
|
FloatingWindow {
|
|
|
|
|
implicitWidth: 700
|
|
|
|
|
title: "qs-wallpicker"
|
|
|
|
|
implicitHeight: 600
|
|
|
|
|
color: Colors.base00
|
|
|
|
|
visible: Settings.config.wallswitchershown
|
|
|
|
|
onClosed: Settings.config.wallswitchershown = false
|
2026-03-11 14:14:04 +01:00
|
|
|
|
|
|
|
|
Rectangle {
|
2026-03-20 11:41:56 +01:00
|
|
|
id: container
|
|
|
|
|
radius: Settings.config.rounding
|
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: 8
|
2026-03-11 14:14:04 +01:00
|
|
|
}
|
2026-03-20 11:41:56 +01:00
|
|
|
color: Colors.base02
|
|
|
|
|
FolderListModel {
|
|
|
|
|
id: wpModel
|
|
|
|
|
folder: "file:///home/lucy/.walls/"
|
|
|
|
|
nameFilters: ["*.png"]
|
|
|
|
|
}
|
|
|
|
|
Component {
|
|
|
|
|
id: wallDelegate
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: wpPreview
|
|
|
|
|
required property var filePath
|
|
|
|
|
implicitWidth: 80
|
|
|
|
|
implicitHeight: 60
|
|
|
|
|
color: "transparent"
|
|
|
|
|
Image {
|
|
|
|
|
asynchronous: true
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
source: wpPreview.filePath ? wpPreview.filePath : null
|
|
|
|
|
}
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: updater
|
|
|
|
|
acceptedButtons: Qt.LeftButton
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: {
|
|
|
|
|
Settings.config.currentWall = wpPreview.filePath;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-03-11 14:14:04 +01:00
|
|
|
}
|
|
|
|
|
}
|
2026-03-20 11:41:56 +01:00
|
|
|
GridView {
|
|
|
|
|
id: wallLayout
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
anchors.margins: 20
|
|
|
|
|
anchors.leftMargin: 40
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
clip: true
|
|
|
|
|
model: wpModel
|
|
|
|
|
delegate: wallDelegate
|
|
|
|
|
}
|
2026-03-11 14:14:04 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|