pragma ComponentBehavior: Bound import Quickshell import Quickshell.Wayland import Quickshell.Hyprland import QtQuick import Qt.labs.folderlistmodel 2.11 import qs import qs.settings import qs.widgets Rectangle { id: main required property real moduleHeight required property int screenHeight color: Colors.moduleBg radius: Config.rounding implicitWidth: moduleHeight implicitHeight: moduleHeight MaterialIcon { anchors.centerIn: main text: "\ue1bc" font.bold: true } MouseArea { id: clickHandler anchors.fill: main acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor onClicked: { wallPicker.visible = !wallPicker.visible; } } WlrLayershell { id: wallPicker visible: true layer: WlrLayer.Top exclusionMode: ExclusionMode.Ignore keyboardFocus: WlrKeyboardFocus.OnDemand implicitHeight: main.screenHeight / 8 color: 'transparent' anchors { bottom: true left: true right: true } margins { bottom: 20 left: 20 right: 20 } HyprlandFocusGrab { id: grabber active: wallPicker.visible windows: [wallPicker] onCleared: wallPicker.visible = false } onVisibleChanged: { if (wallPicker.visible) container.forceActiveFocus(); } Rectangle { id: container focus: true Keys.onEscapePressed: { wallPicker.visible = false; } anchors.fill: parent color: Colors.base01 radius: Config.rounding border.width: 2 border.color: Colors.base0D GridView { id: wallpaperLayout clip: true snapMode: GridView.SnapOneRow flow: GridView.FlowTopToBottom cellHeight: container.height cellWidth: container.width / 7 anchors.fill: parent anchors.centerIn: container anchors.margins: 20 model: wallpaperList delegate: Rectangle { id: wallTile required property var modelData color: 'transparent' implicitWidth: wallpaperLayout.cellWidth - 20 implicitHeight: wallpaperLayout.cellHeight - 20 anchors.margins: 20 clip: true radius: 16 Image { id: wallpaper source: wallTile.modelData.filePath sourceSize.width: 16 * 20 sourceSize.height: 9 * 20 asynchronous: true anchors.fill: parent anchors.verticalCenter: parent.verticalCenter cache: true } MouseArea { id: wpClickHandler anchors.fill: parent cursorShape: Qt.PointingHandCursor acceptedButtons: Qt.LeftButton hoverEnabled: true onClicked: { Config.wallpaper = wallTile.modelData.filePath; } } } } FolderListModel { id: wallpaperList folder: Config.wallDir nameFilters: ["*.png"] } } } }