diff --git a/modules/widgets/wallswitcher/WallSwitcher.qml b/modules/widgets/wallswitcher/WallSwitcher.qml index eb73a50..f0a2a3c 100644 --- a/modules/widgets/wallswitcher/WallSwitcher.qml +++ b/modules/widgets/wallswitcher/WallSwitcher.qml @@ -6,13 +6,29 @@ import Quickshell.Widgets import qs.reusables import Qt.labs.folderlistmodel 2.10 import Quickshell.Io +import qs +import Quickshell.Hyprland FloatingWindow { - id: wallswitcherWindow - implicitHeight: 1200 - implicitWidth: 1800 + id: root + visible: Settings.config.wallSwitcherShown + + Process { + id: wallustRunner + property string cmd: "matugen image " + Settings.config.currentWall + " -t scheme-fidelity" + command: ["sh", "-c", cmd] + } + GlobalShortcut { + name: "showWallSwitcher" + onPressed: { + Settings.config.wallSwitcherShown = true; + } + } + + implicitHeight: 600 + implicitWidth: 900 title: "qs-wallswitcher" - color: "green" + color: Colors.background WrapperItem { id: innerWindowWrapper anchors.centerIn: parent @@ -31,7 +47,7 @@ FloatingWindow { topMargin: innerWindowText.implicitHeight + innerWindowText.topPadding anchors.fill: parent anchors.horizontalCenter: parent.horizontalCenter - leftMargin: 20 + leftMargin: 40 rightMargin: 20 FolderListModel { @@ -43,17 +59,16 @@ FloatingWindow { Component { id: fileDelegate Image { + asynchronous: true + cache: true required property string filePath source: filePath width: 120 height: 80 + sourceSize.width: 120 + sourceSize.height: 80 MouseArea { id: wallpaperSetter - Process { - id: wallustRunner - property string cmd: "matugen image " + Settings.config.currentWall + " -t scheme-fidelity" - command: ["sh", "-c", cmd] - } acceptedButtons: Qt.LeftButton anchors.fill: parent cursorShape: Qt.PointingHandCursor @@ -72,11 +87,11 @@ FloatingWindow { } radius: 24 - color: "black" + color: Colors.background CustomText { id: innerWindowText topPadding: 10 - text: "Hello, world!" + text: "Wallpapers in " + Settings.config.wallDir anchors.horizontalCenter: parent.horizontalCenter } } diff --git a/settings/Settings.qml b/settings/Settings.qml index cd7808f..6986367 100644 --- a/settings/Settings.qml +++ b/settings/Settings.qml @@ -33,6 +33,7 @@ Singleton { property int paddingTop: 10 property int paddingSides: 10 property var generateScheme: true + property bool wallSwitcherShown: false } } }