From 49119bf0de530f286efd24238e82b32888bdfdda Mon Sep 17 00:00:00 2001 From: lucy Date: Tue, 27 Jan 2026 10:49:01 +0100 Subject: [PATCH] fix wallswitcher and add button to open settings in bar --- modules/bar/Bar.qml | 1 + modules/bar/SettingsIcon.qml | 29 +++++++++++++++++++ modules/widgets/settingsapp/MainWindow.qml | 4 +++ modules/widgets/wallswitcher/WallSwitcher.qml | 2 +- settings/Settings.qml | 1 + shell.qml | 1 + 6 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 modules/bar/SettingsIcon.qml diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 6571b6b..f68bc96 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -60,6 +60,7 @@ Variants { Volume {} Battery {} SysTray {} + SettingsIcon {} } } } diff --git a/modules/bar/SettingsIcon.qml b/modules/bar/SettingsIcon.qml new file mode 100644 index 0000000..29d2bb7 --- /dev/null +++ b/modules/bar/SettingsIcon.qml @@ -0,0 +1,29 @@ +import QtQuick +import qs.modules.widgets.settingsapp +import qs.settings +import qs.reusables +import qs + +Rectangle { + id: root + radius: implicitHeight / 2 + color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer + anchors.verticalCenter: parent.verticalCenter + implicitWidth: volumeIcon.implicitWidth + 5 + implicitHeight: Settings.config.barHeight - 10 + CustomIcon { + id: volumeIcon + anchors.centerIn: parent + text: "settings" + } + MouseArea { + id: pavuArea + anchors.fill: root + onClicked: { + Settings.config.settingsShown = true; + } + acceptedButtons: Qt.LeftButton + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + } +} diff --git a/modules/widgets/settingsapp/MainWindow.qml b/modules/widgets/settingsapp/MainWindow.qml index f5a97e3..f17a7e1 100644 --- a/modules/widgets/settingsapp/MainWindow.qml +++ b/modules/widgets/settingsapp/MainWindow.qml @@ -10,6 +10,10 @@ import qs.reusables FloatingWindow { id: root + visible: Settings.config.settingsShown + onClosed: { + Settings.config.settingsShown = false; + } color: Colors.surface title: "qs-settings" implicitWidth: 800 diff --git a/modules/widgets/wallswitcher/WallSwitcher.qml b/modules/widgets/wallswitcher/WallSwitcher.qml index a38d98f..0ae305d 100644 --- a/modules/widgets/wallswitcher/WallSwitcher.qml +++ b/modules/widgets/wallswitcher/WallSwitcher.qml @@ -65,6 +65,7 @@ FloatingWindow { color: Colors.surfaceContainerLow GridView { id: gridRoot + anchors.margins: 20 property var columns: Math.floor(gridRoot.width / cellWidth) property var usedWidth: columns * cellWidth property var emptySpace: width - usedWidth @@ -79,7 +80,6 @@ FloatingWindow { anchors.fill: innerWindow anchors.centerIn: innerWindow leftMargin: emptySpace / 2 - topMargin: 20 model: folderModel delegate: fileDelegate FolderListModel { diff --git a/settings/Settings.qml b/settings/Settings.qml index e585400..ae5a6c9 100644 --- a/settings/Settings.qml +++ b/settings/Settings.qml @@ -34,6 +34,7 @@ Singleton { property int screenCornerRadius: 10 property double translucency: 1 property bool blackScreenCorners: true + property bool settingsShown: true } } } diff --git a/shell.qml b/shell.qml index 1a3a5cf..678bf86 100644 --- a/shell.qml +++ b/shell.qml @@ -15,4 +15,5 @@ ShellRoot { Notification {} WallSwitcher {} Ipc {} + MainWindow {} }