68 lines
1.8 KiB
QML
Raw Normal View History

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
FloatingWindow {
id: root
implicitWidth: 700
title: "qs-wallpicker"
implicitHeight: 600
2026-03-19 11:32:23 +01:00
color: Colors.base00
2026-03-11 14:14:04 +01:00
visible: Settings.config.wallswitchershown
onClosed: Settings.config.wallswitchershown = false
Rectangle {
id: container
radius: Settings.config.rounding
anchors {
fill: parent
margins: 8
}
2026-03-19 11:32:23 +01:00
color: Colors.base02
2026-03-11 14:14:04 +01:00
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;
}
}
}
}
GridView {
id: wallLayout
anchors.centerIn: parent
anchors.margins: 20
anchors.leftMargin: 40
anchors.fill: parent
clip: true
model: wpModel
delegate: wallDelegate
}
}
}