From 452f5111e57d41afd784c59fd95b446433e822e7 Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Mon, 16 Mar 2026 23:04:50 +0200 Subject: [PATCH 01/13] Add dashboard animation parameters --- src/share/sleex/modules/common/Config.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/share/sleex/modules/common/Config.qml b/src/share/sleex/modules/common/Config.qml index 18c862f..aed093b 100644 --- a/src/share/sleex/modules/common/Config.qml +++ b/src/share/sleex/modules/common/Config.qml @@ -197,6 +197,8 @@ Singleton { property JsonObject dashboard: JsonObject { property real dashboardScale: 1.0 // Overall scale of the dashboard + property string animationDirection: "up" + property int animationDuration: 250 property string ghUsername: "levraiardox" property string avatarPath: "file:///usr/share/pixmaps/sleex/1024px/white.png" property string userDesc: "Today is a good day to have a good day!" From 9d60e6ce7a5cd4f6d7d3c36d1a231a9e387978fb Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Mon, 16 Mar 2026 23:07:58 +0200 Subject: [PATCH 02/13] Add dashboard direction and animation settings --- src/share/sleex/modules/settings/Style.qml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/share/sleex/modules/settings/Style.qml b/src/share/sleex/modules/settings/Style.qml index c164823..aad8e2e 100644 --- a/src/share/sleex/modules/settings/Style.qml +++ b/src/share/sleex/modules/settings/Style.qml @@ -18,6 +18,7 @@ ContentPage { readonly property var paletteKeys: ["auto", "scheme-content", "scheme-expressive", "scheme-fidelity", "scheme-fruit-salad", "scheme-monochrome", "scheme-neutral", "scheme-rainbow", "scheme-tonal-spot"] readonly property var transitionKeys: ["fade", "scale", "wipe"] readonly property var wipeOrientationKeys: ["wipe_left", "wipe", "wipe_up", "wipe_down"] + readonly property var dashboardAnimationKeys: ["left", "right", "up", "down"] readonly property bool isWipeSelected: { const t = Config.options.background.wallpaperTransition @@ -99,6 +100,46 @@ ContentPage { } } + ContentSection { + title: "Dashboard" + + StyledText { + text: "Animation Direction" + color: Appearance.colors.colSubtext + } + + StyledComboBox { + id: dashboardAnimationComboBox + model: ["Right", "Left", "Down", "Up"] + currentIndex: Math.max(0, dashboardAnimationKeys.indexOf(Config.options.dashboard.animationDirection)) + + onActivated: (index) => { + const selectedValue = dashboardAnimationKeys[index] + if (Config.options.dashboard.animationDirection !== selectedValue) { + Config.options.dashboard.animationDirection = selectedValue + } + } + } + + StyledText { + text: "Animation Intensity" + color: Appearance.colors.colSubtext + } + + StyledSlider { + id: dashboardAnimationSlider + from: 0 + to: 1 + value: Config.options.dashboard.animationDuration / 1000 + + onMoved: { + if (Config.loaded) { + Config.options.dashboard.animationDuration = value * 1000 + } + } + } + } + ContentSection { title: "Wallpaper" From b4cf9222f5cf3b56ef147a943e5a706fa899eceb Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Mon, 16 Mar 2026 23:09:10 +0200 Subject: [PATCH 03/13] Overhaul dashboard with optimisations, smoothness and efficiency improvements --- .../sleex/modules/dashboard/Dashboard.qml | 140 ++++++++++++------ 1 file changed, 96 insertions(+), 44 deletions(-) diff --git a/src/share/sleex/modules/dashboard/Dashboard.qml b/src/share/sleex/modules/dashboard/Dashboard.qml index 8df2cc8..22bc248 100644 --- a/src/share/sleex/modules/dashboard/Dashboard.qml +++ b/src/share/sleex/modules/dashboard/Dashboard.qml @@ -8,7 +8,6 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import QtQuick.Effects -import Qt5Compat.GraphicalEffects import Quickshell.Io import Quickshell import Quickshell.Widgets @@ -17,33 +16,42 @@ import Quickshell.Hyprland import Quickshell.Bluetooth Scope { + id: dashboardScope + property int dashboardWidth: Appearance.sizes.dashboardWidth property int dashboardPadding: 15 property real dashboardScale: Config.options.dashboard.dashboardScale - + + function openDashboard(): void { + GlobalStates.dashboardOpen = true + Notifications.timeoutAll() + } + function closeDashboard(): void { GlobalStates.dashboardOpen = false } + function toggleDashboard(): void { + if (GlobalStates.dashboardOpen) closeDashboard() + else openDashboard() + } + PanelWindow { id: dashboardRoot - visible: GlobalStates.dashboardOpen - - function hide() { - GlobalStates.dashboardOpen = false - } + visible: true + function hide(): void { dashboardScope.closeDashboard() } exclusiveZone: 0 implicitWidth: 1500 * dashboardScale implicitHeight: 900 * dashboardScale WlrLayershell.namespace: "quickshell:dashboard" - // Hyprland 0.49: Focus is always exclusive and setting this breaks mouse focus grab - // WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive + WlrLayershell.layer: WlrLayer.Overlay color: "transparent" + mask: GlobalStates.dashboardOpen ? null : emptyRegion + + Region { id: emptyRegion } HyprlandFocusGrab { id: grab windows: [ dashboardRoot ] active: GlobalStates.dashboardOpen - onCleared: () => { - if (!active) dashboardRoot.hide() - } + onCleared: () => { if (!active) dashboardRoot.hide() } } Item { @@ -53,9 +61,67 @@ Scope { height: parent.height / dashboardScale scale: dashboardScale + property bool isAnimating: false + property bool slideAnimEnabled: true + + Connections { + target: GlobalStates + function onDashboardOpenChanged() { + scaleWrapper.isAnimating = true + closeHoldTimer.restart() + } + } + Timer { + id: closeHoldTimer + interval: Config.options.dashboard.animationDuration + 50 + onTriggered: scaleWrapper.isAnimating = false + } + Connections { + target: Config.options.dashboard + function onAnimationDirectionChanged() { + scaleWrapper.slideAnimEnabled = false + Qt.callLater(() => { scaleWrapper.slideAnimEnabled = true }) + } + } + Loader { id: dashboardContentLoader - active: GlobalStates.dashboardOpen + active: true + visible: GlobalStates.dashboardOpen || scaleWrapper.isAnimating + + transform: Translate { + x: { + if (GlobalStates.dashboardOpen) return 0 + const dir = Config.options.dashboard.animationDirection + if (dir === "left") return -scaleWrapper.width + if (dir === "right") return scaleWrapper.width + return 0 + } + y: { + if (GlobalStates.dashboardOpen) return 0 + const dir = Config.options.dashboard.animationDirection + if (dir === "up") return -scaleWrapper.height + if (dir === "down") return scaleWrapper.height + return 0 + } + Behavior on x { + enabled: scaleWrapper.slideAnimEnabled + NumberAnimation { + duration: Config.options.dashboard.animationDuration + easing.type: Easing.BezierSpline + easing.bezierCurve: [0.4, 0.0, 0.2, 1.0, 1.0, 1.0] + } + } + Behavior on y { + enabled: scaleWrapper.slideAnimEnabled + NumberAnimation { + duration: Config.options.dashboard.animationDuration + easing.type: Easing.BezierSpline + easing.bezierCurve: [0.4, 0.0, 0.2, 1.0, 1.0, 1.0] + } + } + } + anchors { top: parent.top bottom: parent.bottom @@ -68,12 +134,9 @@ Scope { } width: dashboardWidth - Appearance.sizes.hyprlandGapsOut - Appearance.sizes.elevationMargin height: parent.height - Appearance.sizes.hyprlandGapsOut * 2 - focus: GlobalStates.dashboardOpen Keys.onPressed: (event) => { - if (event.key === Qt.Key_Escape) { - dashboardRoot.hide(); - } + if (event.key === Qt.Key_Escape) dashboardRoot.hide() } sourceComponent: Item { @@ -108,16 +171,19 @@ Scope { Item { implicitWidth: distroIcon.width implicitHeight: distroIcon.height + CustomIcon { id: distroIcon width: 30 height: 30 source: SystemInfo.distroIcon } - ColorOverlay { - anchors.fill: distroIcon + + MultiEffect { source: distroIcon - color: Appearance.colors.colOnLayer0 + anchors.fill: distroIcon + colorization: 1.0 + colorizationColor: Appearance.colors.colOnLayer0 } } @@ -144,14 +210,14 @@ Scope { buttonIcon: "settings" onClicked: { Quickshell.execDetached(["qs", "-p", "/usr/share/sleex/settings.qml"]) - GlobalStates.dashboardOpen = false + dashboardScope.closeDashboard() } StyledToolTip { text: qsTr("Settings") } } QuickToggleButton { toggled: false buttonIcon: "power_settings_new" - onClicked: { Hyprland.dispatch("global quickshell:sessionOpen") } + onClicked: Hyprland.dispatch("global quickshell:sessionOpen") StyledToolTip { text: qsTr("Session") } } } @@ -166,6 +232,7 @@ Scope { Loader { active: Bluetooth.adapters.values.length > 0 + asynchronous: true sourceComponent: BluetoothToggle {} } @@ -180,10 +247,9 @@ Scope { Layout.fillHeight: true Layout.preferredHeight: 600 Layout.preferredWidth: dashboardWidth - dashboardPadding * 2 - onCurrentTabChanged: { if (currentTab === "greetings") - Notifications.timeoutAll(); + Notifications.timeoutAll() } } } @@ -195,38 +261,24 @@ Scope { IpcHandler { target: "dashboard" - - function toggle(): void { - GlobalStates.dashboardOpen = !GlobalStates.dashboardOpen; - if(GlobalStates.dashboardOpen) Notifications.timeoutAll(); - } - - function close(): void { GlobalStates.dashboardOpen = false; } - function open(): void { - GlobalStates.dashboardOpen = true; - Notifications.timeoutAll(); - } + function toggle(): void { dashboardScope.toggleDashboard() } + function close(): void { dashboardScope.closeDashboard() } + function open(): void { dashboardScope.openDashboard() } } GlobalShortcut { name: "dashboardToggle" description: qsTr("Toggles dashboard on press") - onPressed: { - GlobalStates.dashboardOpen = !GlobalStates.dashboardOpen; - if(GlobalStates.dashboardOpen) Notifications.timeoutAll(); - } + onPressed: dashboardScope.toggleDashboard() } GlobalShortcut { name: "dashboardOpen" description: qsTr("Opens dashboard on press") - onPressed: { - GlobalStates.dashboardOpen = true; - Notifications.timeoutAll(); - } + onPressed: dashboardScope.openDashboard() } GlobalShortcut { name: "dashboardClose" description: qsTr("Closes dashboard on press") - onPressed: { GlobalStates.dashboardOpen = false; } + onPressed: dashboardScope.closeDashboard() } } From a65629f7ca0ad552f8dc7b1da9e5a1ae3fd8aed5 Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Tue, 17 Mar 2026 00:29:04 +0200 Subject: [PATCH 04/13] Add dashboard direction and animation --- src/share/sleex/modules/common/Config.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/sleex/modules/common/Config.qml b/src/share/sleex/modules/common/Config.qml index aed093b..4c7d0bd 100644 --- a/src/share/sleex/modules/common/Config.qml +++ b/src/share/sleex/modules/common/Config.qml @@ -198,7 +198,7 @@ Singleton { property JsonObject dashboard: JsonObject { property real dashboardScale: 1.0 // Overall scale of the dashboard property string animationDirection: "up" - property int animationDuration: 250 + property int animationDuration: 300 property string ghUsername: "levraiardox" property string avatarPath: "file:///usr/share/pixmaps/sleex/1024px/white.png" property string userDesc: "Today is a good day to have a good day!" From 00f9e26d2f0dc24664687973cb455cda54b3c7db Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Tue, 17 Mar 2026 00:39:30 +0200 Subject: [PATCH 05/13] Updated default animation duration --- src/share/sleex/modules/common/Config.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/sleex/modules/common/Config.qml b/src/share/sleex/modules/common/Config.qml index 4c7d0bd..94bed66 100644 --- a/src/share/sleex/modules/common/Config.qml +++ b/src/share/sleex/modules/common/Config.qml @@ -198,7 +198,7 @@ Singleton { property JsonObject dashboard: JsonObject { property real dashboardScale: 1.0 // Overall scale of the dashboard property string animationDirection: "up" - property int animationDuration: 300 + property int animationDuration: 400 property string ghUsername: "levraiardox" property string avatarPath: "file:///usr/share/pixmaps/sleex/1024px/white.png" property string userDesc: "Today is a good day to have a good day!" From aa1836cab4cb127b9469ea86c228cabdbc6fe328 Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Wed, 18 Mar 2026 15:02:08 +0200 Subject: [PATCH 06/13] This is the smoothest most optimised thing ever --- .../sleex/modules/dashboard/Dashboard.qml | 60 ++++++++++++------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/src/share/sleex/modules/dashboard/Dashboard.qml b/src/share/sleex/modules/dashboard/Dashboard.qml index 22bc248..f47dd63 100644 --- a/src/share/sleex/modules/dashboard/Dashboard.qml +++ b/src/share/sleex/modules/dashboard/Dashboard.qml @@ -38,8 +38,8 @@ Scope { function hide(): void { dashboardScope.closeDashboard() } exclusiveZone: 0 - implicitWidth: 1500 * dashboardScale - implicitHeight: 900 * dashboardScale + implicitWidth: Screen.width + implicitHeight: Screen.height WlrLayershell.namespace: "quickshell:dashboard" WlrLayershell.layer: WlrLayer.Overlay color: "transparent" @@ -57,13 +57,28 @@ Scope { Item { id: scaleWrapper anchors.centerIn: parent - width: parent.width / dashboardScale - height: parent.height / dashboardScale + width: 1500 + height: 900 scale: dashboardScale property bool isAnimating: false - property bool slideAnimEnabled: true + property bool slideAnimEnabled: false + property string animDir: "" + property int animDuration: Config.options.dashboard.animationDuration + // Use full screen dimensions so the panel fully exits the screen + // in every direction, regardless of where scaleWrapper is centered. + readonly property int targetX: animDir === "left" ? -dashboardRoot.width + : animDir === "right" ? dashboardRoot.width : 0 + readonly property int targetY: animDir === "up" ? -dashboardRoot.height + : animDir === "down" ? dashboardRoot.height : 0 + + Component.onCompleted: { + animDir = Config.options.dashboard.animationDirection + Qt.callLater(() => { slideAnimEnabled = true }) + } + + // Keep loader visible for the full duration of the close animation. Connections { target: GlobalStates function onDashboardOpenChanged() { @@ -76,10 +91,12 @@ Scope { interval: Config.options.dashboard.animationDuration + 50 onTriggered: scaleWrapper.isAnimating = false } + Connections { target: Config.options.dashboard function onAnimationDirectionChanged() { scaleWrapper.slideAnimEnabled = false + scaleWrapper.animDir = Config.options.dashboard.animationDirection Qt.callLater(() => { scaleWrapper.slideAnimEnabled = true }) } } @@ -87,27 +104,26 @@ Scope { Loader { id: dashboardContentLoader active: true + // Load content on a background thread — zero main-thread + // blocking at startup, content is ready before first open. + asynchronous: true visible: GlobalStates.dashboardOpen || scaleWrapper.isAnimating + // Keep the layer always primed so the GPU texture is ready + // the instant an animation begins — no first-frame stall. + layer.enabled: true + // Integer-pixel translations need no sub-pixel smoothing; + // disabling it removes a per-frame GPU filtering pass. + layer.smooth: false + layer.mipmap: false + transform: Translate { - x: { - if (GlobalStates.dashboardOpen) return 0 - const dir = Config.options.dashboard.animationDirection - if (dir === "left") return -scaleWrapper.width - if (dir === "right") return scaleWrapper.width - return 0 - } - y: { - if (GlobalStates.dashboardOpen) return 0 - const dir = Config.options.dashboard.animationDirection - if (dir === "up") return -scaleWrapper.height - if (dir === "down") return scaleWrapper.height - return 0 - } + x: GlobalStates.dashboardOpen ? 0 : scaleWrapper.targetX + y: GlobalStates.dashboardOpen ? 0 : scaleWrapper.targetY Behavior on x { enabled: scaleWrapper.slideAnimEnabled NumberAnimation { - duration: Config.options.dashboard.animationDuration + duration: scaleWrapper.animDuration easing.type: Easing.BezierSpline easing.bezierCurve: [0.4, 0.0, 0.2, 1.0, 1.0, 1.0] } @@ -115,7 +131,7 @@ Scope { Behavior on y { enabled: scaleWrapper.slideAnimEnabled NumberAnimation { - duration: Config.options.dashboard.animationDuration + duration: scaleWrapper.animDuration easing.type: Easing.BezierSpline easing.bezierCurve: [0.4, 0.0, 0.2, 1.0, 1.0, 1.0] } @@ -132,8 +148,6 @@ Scope { bottomMargin: Appearance.sizes.hyprlandGapsOut leftMargin: Appearance.sizes.elevationMargin } - width: dashboardWidth - Appearance.sizes.hyprlandGapsOut - Appearance.sizes.elevationMargin - height: parent.height - Appearance.sizes.hyprlandGapsOut * 2 focus: GlobalStates.dashboardOpen Keys.onPressed: (event) => { if (event.key === Qt.Key_Escape) dashboardRoot.hide() From eb1f8a39bf4be57ade802035bb83754294816b7f Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Wed, 18 Mar 2026 15:12:40 +0200 Subject: [PATCH 07/13] Update Style.qml --- src/share/sleex/modules/settings/Style.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/share/sleex/modules/settings/Style.qml b/src/share/sleex/modules/settings/Style.qml index aad8e2e..07d6278 100644 --- a/src/share/sleex/modules/settings/Style.qml +++ b/src/share/sleex/modules/settings/Style.qml @@ -130,11 +130,11 @@ ContentPage { id: dashboardAnimationSlider from: 0 to: 1 - value: Config.options.dashboard.animationDuration / 1000 + value: Config.options.dashboard.animationDuration / 1500 onMoved: { if (Config.loaded) { - Config.options.dashboard.animationDuration = value * 1000 + Config.options.dashboard.animationDuration = value * 1500 } } } From 29a0eb46213c5a69e109536c83ddf4a4dc9eca4f Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Wed, 18 Mar 2026 15:38:08 +0200 Subject: [PATCH 08/13] Update Style.qml From 58505989353adb6b272e48f2683c7c7e9a30a736 Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Wed, 18 Mar 2026 15:40:03 +0200 Subject: [PATCH 09/13] Fixed blurry text issue that occurs when using dashboard scale feature --- .../sleex/modules/dashboard/Dashboard.qml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/share/sleex/modules/dashboard/Dashboard.qml b/src/share/sleex/modules/dashboard/Dashboard.qml index f47dd63..e09b0b1 100644 --- a/src/share/sleex/modules/dashboard/Dashboard.qml +++ b/src/share/sleex/modules/dashboard/Dashboard.qml @@ -66,12 +66,14 @@ Scope { property string animDir: "" property int animDuration: Config.options.dashboard.animationDuration - // Use full screen dimensions so the panel fully exits the screen - // in every direction, regardless of where scaleWrapper is centered. - readonly property int targetX: animDir === "left" ? -dashboardRoot.width - : animDir === "right" ? dashboardRoot.width : 0 - readonly property int targetY: animDir === "up" ? -dashboardRoot.height - : animDir === "down" ? dashboardRoot.height : 0 + // Divide by dashboardScale because the Translate operates in + // scaleWrapper's local (pre-scale) coordinate space. Without this, + // the actual screen movement is target * dashboardScale, which + // under-shoots at scale < 1 and over-shoots at scale > 1. + readonly property int targetX: animDir === "left" ? -dashboardRoot.width / dashboardScale + : animDir === "right" ? dashboardRoot.width / dashboardScale : 0 + readonly property int targetY: animDir === "up" ? -dashboardRoot.height / dashboardScale + : animDir === "down" ? dashboardRoot.height / dashboardScale : 0 Component.onCompleted: { animDir = Config.options.dashboard.animationDirection @@ -112,10 +114,9 @@ Scope { // Keep the layer always primed so the GPU texture is ready // the instant an animation begins — no first-frame stall. layer.enabled: true - // Integer-pixel translations need no sub-pixel smoothing; + layer.smooth: true + // disabling it removes a per-frame GPU filtering pass. - layer.smooth: false - layer.mipmap: false transform: Translate { x: GlobalStates.dashboardOpen ? 0 : scaleWrapper.targetX From a9cbb625df891cb16d878f1cb51f61dc55316d27 Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:04:10 +0200 Subject: [PATCH 10/13] Update Config.qml --- src/share/sleex/modules/common/Config.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/sleex/modules/common/Config.qml b/src/share/sleex/modules/common/Config.qml index 94bed66..aed093b 100644 --- a/src/share/sleex/modules/common/Config.qml +++ b/src/share/sleex/modules/common/Config.qml @@ -198,7 +198,7 @@ Singleton { property JsonObject dashboard: JsonObject { property real dashboardScale: 1.0 // Overall scale of the dashboard property string animationDirection: "up" - property int animationDuration: 400 + property int animationDuration: 250 property string ghUsername: "levraiardox" property string avatarPath: "file:///usr/share/pixmaps/sleex/1024px/white.png" property string userDesc: "Today is a good day to have a good day!" From c58841c1c1950637565979a62295aee5135df1be Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:05:57 +0200 Subject: [PATCH 11/13] Refined default animation duration --- src/share/sleex/modules/common/Config.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/sleex/modules/common/Config.qml b/src/share/sleex/modules/common/Config.qml index aed093b..4c7d0bd 100644 --- a/src/share/sleex/modules/common/Config.qml +++ b/src/share/sleex/modules/common/Config.qml @@ -198,7 +198,7 @@ Singleton { property JsonObject dashboard: JsonObject { property real dashboardScale: 1.0 // Overall scale of the dashboard property string animationDirection: "up" - property int animationDuration: 250 + property int animationDuration: 300 property string ghUsername: "levraiardox" property string avatarPath: "file:///usr/share/pixmaps/sleex/1024px/white.png" property string userDesc: "Today is a good day to have a good day!" From 716971c67f54f6993fbded0d95b64368d180a4af Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:12:57 +0200 Subject: [PATCH 12/13] Update Dashboard.qml --- .../sleex/modules/dashboard/Dashboard.qml | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/src/share/sleex/modules/dashboard/Dashboard.qml b/src/share/sleex/modules/dashboard/Dashboard.qml index e09b0b1..f3d4353 100644 --- a/src/share/sleex/modules/dashboard/Dashboard.qml +++ b/src/share/sleex/modules/dashboard/Dashboard.qml @@ -22,26 +22,16 @@ Scope { property int dashboardPadding: 15 property real dashboardScale: Config.options.dashboard.dashboardScale - function openDashboard(): void { - GlobalStates.dashboardOpen = true - Notifications.timeoutAll() - } - function closeDashboard(): void { GlobalStates.dashboardOpen = false } - function toggleDashboard(): void { - if (GlobalStates.dashboardOpen) closeDashboard() - else openDashboard() - } - PanelWindow { id: dashboardRoot visible: true - function hide(): void { dashboardScope.closeDashboard() } exclusiveZone: 0 implicitWidth: Screen.width implicitHeight: Screen.height WlrLayershell.namespace: "quickshell:dashboard" WlrLayershell.layer: WlrLayer.Overlay + color: "transparent" mask: GlobalStates.dashboardOpen ? null : emptyRegion @@ -51,7 +41,7 @@ Scope { id: grab windows: [ dashboardRoot ] active: GlobalStates.dashboardOpen - onCleared: () => { if (!active) dashboardRoot.hide() } + onCleared: () => { if (!active) ipc.close() } } Item { @@ -63,20 +53,20 @@ Scope { property bool isAnimating: false property bool slideAnimEnabled: false - property string animDir: "" + + property string animDir: Config.options.dashboard.animationDirection property int animDuration: Config.options.dashboard.animationDuration // Divide by dashboardScale because the Translate operates in - // scaleWrapper's local (pre-scale) coordinate space. Without this, - // the actual screen movement is target * dashboardScale, which + // scaleWrapper's local (pre-scale) coordinate space. + // Without this, the actual screen movement is target * dashboardScale, which // under-shoots at scale < 1 and over-shoots at scale > 1. readonly property int targetX: animDir === "left" ? -dashboardRoot.width / dashboardScale - : animDir === "right" ? dashboardRoot.width / dashboardScale : 0 + : animDir === "right" ? dashboardRoot.width / dashboardScale : 0 readonly property int targetY: animDir === "up" ? -dashboardRoot.height / dashboardScale - : animDir === "down" ? dashboardRoot.height / dashboardScale : 0 + : animDir === "down" ? dashboardRoot.height / dashboardScale : 0 Component.onCompleted: { - animDir = Config.options.dashboard.animationDirection Qt.callLater(() => { slideAnimEnabled = true }) } @@ -117,7 +107,6 @@ Scope { layer.smooth: true // disabling it removes a per-frame GPU filtering pass. - transform: Translate { x: GlobalStates.dashboardOpen ? 0 : scaleWrapper.targetX y: GlobalStates.dashboardOpen ? 0 : scaleWrapper.targetY @@ -132,7 +121,7 @@ Scope { Behavior on y { enabled: scaleWrapper.slideAnimEnabled NumberAnimation { - duration: scaleWrapper.animDuration + duration: scaleWrapper.animDuration easing.type: Easing.BezierSpline easing.bezierCurve: [0.4, 0.0, 0.2, 1.0, 1.0, 1.0] } @@ -151,7 +140,7 @@ Scope { } focus: GlobalStates.dashboardOpen Keys.onPressed: (event) => { - if (event.key === Qt.Key_Escape) dashboardRoot.hide() + if (event.key === Qt.Key_Escape) ipc.close() } sourceComponent: Item { @@ -225,7 +214,7 @@ Scope { buttonIcon: "settings" onClicked: { Quickshell.execDetached(["qs", "-p", "/usr/share/sleex/settings.qml"]) - dashboardScope.closeDashboard() + ipc.close() } StyledToolTip { text: qsTr("Settings") } } @@ -275,25 +264,32 @@ Scope { } IpcHandler { + id: ipc target: "dashboard" - function toggle(): void { dashboardScope.toggleDashboard() } - function close(): void { dashboardScope.closeDashboard() } - function open(): void { dashboardScope.openDashboard() } + function toggle(): void { + if (GlobalStates.dashboardOpen) close() + else open() + } + function close(): void { GlobalStates.dashboardOpen = false } + function open(): void { + GlobalStates.dashboardOpen = true + Notifications.timeoutAll() + } } GlobalShortcut { name: "dashboardToggle" description: qsTr("Toggles dashboard on press") - onPressed: dashboardScope.toggleDashboard() + onPressed: ipc.toggle() } GlobalShortcut { name: "dashboardOpen" description: qsTr("Opens dashboard on press") - onPressed: dashboardScope.openDashboard() + onPressed: ipc.open() } GlobalShortcut { name: "dashboardClose" description: qsTr("Closes dashboard on press") - onPressed: dashboardScope.closeDashboard() + onPressed: ipc.close() } } From 82dcda98ca37830409a35bf33f8a290adb14f50b Mon Sep 17 00:00:00 2001 From: Armiel <125122987+Abscissa24@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:18:24 +0200 Subject: [PATCH 13/13] Update Style.qml