From 7cdfa5f82b5c6e9cd2aee65ab9c8696a20ed734a Mon Sep 17 00:00:00 2001 From: ly-sec Date: Fri, 18 Jul 2025 22:47:38 +0200 Subject: [PATCH] Add Dim Desktop option --- .gitignore | 3 +- Components/PanelWithOverlay.qml | 2 +- Settings/Settings.qml | 1 + Widgets/Sidebar/Config/ProfileSettings.qml | 54 ++++++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bb3cef2..fed6799 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.qmlls.ini \ No newline at end of file +.qmlls.ini +notification_history.json \ No newline at end of file diff --git a/Components/PanelWithOverlay.qml b/Components/PanelWithOverlay.qml index 0f83b51..027ff41 100644 --- a/Components/PanelWithOverlay.qml +++ b/Components/PanelWithOverlay.qml @@ -5,7 +5,7 @@ import qs.Settings PanelWindow { id: outerPanel - property bool showOverlay: true + property bool showOverlay: Settings.settings.dimPanels property int topMargin: 36 property color overlayColor: showOverlay ? Theme.overlay : "transparent" diff --git a/Settings/Settings.qml b/Settings/Settings.qml index 9947760..426bc39 100644 --- a/Settings/Settings.qml +++ b/Settings/Settings.qml @@ -56,6 +56,7 @@ Singleton { property string visualizerType: "radial" property bool reverseDayMonth: false property bool use12HourClock: false + property bool dimPanels: true } } diff --git a/Widgets/Sidebar/Config/ProfileSettings.qml b/Widgets/Sidebar/Config/ProfileSettings.qml index 22b8484..da42357 100644 --- a/Widgets/Sidebar/Config/ProfileSettings.qml +++ b/Widgets/Sidebar/Config/ProfileSettings.qml @@ -307,6 +307,60 @@ Rectangle { } } + // Dim Windows Setting + RowLayout { + spacing: 8 + Layout.fillWidth: true + Layout.topMargin: 8 + + Text { + text: "Dim Desktop" + font.family: Theme.fontFamily + font.pixelSize: 13 + font.bold: true + color: Theme.textPrimary + } + + Item { + Layout.fillWidth: true + } + + // Custom Material 3 Switch + Rectangle { + id: dimWindowsSwitch + width: 52 + height: 32 + radius: 16 + color: Settings.settings.dimPanels ? Theme.accentPrimary : Theme.surfaceVariant + border.color: Settings.settings.dimPanels ? Theme.accentPrimary : Theme.outline + border.width: 2 + + Rectangle { + id: dimWindowsThumb + width: 28 + height: 28 + radius: 14 + color: Theme.surface + border.color: Theme.outline + border.width: 1 + y: 2 + x: Settings.settings.dimPanels ? dimWindowsSwitch.width - width - 2 : 2 + + Behavior on x { + NumberAnimation { duration: 200; easing.type: Easing.OutCubic } + } + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + Settings.settings.dimPanels = !Settings.settings.dimPanels + } + } + } + } + // Visualizer Type Selection ColumnLayout { spacing: 8