From 5bcface15ad17cd352fb4c9b5b76ac6d6c7feb4d Mon Sep 17 00:00:00 2001 From: Noah Zepner Date: Thu, 7 Aug 2025 04:32:37 +0200 Subject: dashboard: showOnHover config option (#361) * dashboard: showOnHover config option * dashboard: close on lose focus when !showOnHover Also update readme --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- README.md | 3 +++ config/DashboardConfig.qml | 1 + modules/dashboard/Wrapper.qml | 7 +++++++ modules/drawers/Interactions.qml | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fed74e8..5b43125 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,10 @@ All configuration options are in `~/.config/caelestia/shell.json`. "thickness": 10 }, "dashboard": { + "enabled": true, + "dragThreshold": 50, "mediaUpdateInterval": 500, + "showOnHover": true, "visualiserBars": 45 }, "launcher": { diff --git a/config/DashboardConfig.qml b/config/DashboardConfig.qml index b6388e5..26d2442 100644 --- a/config/DashboardConfig.qml +++ b/config/DashboardConfig.qml @@ -2,6 +2,7 @@ import Quickshell.Io JsonObject { property bool enabled: true + property bool showOnHover: true property int mediaUpdateInterval: 500 property int visualiserBars: 45 property int dragThreshold: 50 diff --git a/modules/dashboard/Wrapper.qml b/modules/dashboard/Wrapper.qml index 9863e01..1a547c9 100644 --- a/modules/dashboard/Wrapper.qml +++ b/modules/dashboard/Wrapper.qml @@ -4,6 +4,7 @@ import qs.components.filedialog import qs.config import qs.utils import Quickshell +import Quickshell.Hyprland import QtQuick Item { @@ -64,6 +65,12 @@ Item { } ] + HyprlandFocusGrab { + active: !Config.dashboard.showOnHover && root.visibilities.dashboard && Config.dashboard.enabled + windows: [QsWindow.window] + onCleared: root.visibilities.dashboard = false + } + Loader { id: content diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 7b18adf..1cd1736 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -120,7 +120,7 @@ MouseArea { } // Show dashboard on hover - const showDashboard = inTopPanel(panels.dashboard, x, y); + const showDashboard = Config.dashboard.showOnHover && inTopPanel(panels.dashboard, x, y); // Always update visibility based on hover if not in shortcut mode if (!dashboardShortcutActive) { -- cgit v1.2.3-freya