From 6e6db08726e3bc274594de6835a01fc10002def9 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 17 May 2025 00:44:00 +0800 Subject: feat: dashboard --- modules/drawers/Backgrounds.qml | 8 ++++++++ modules/drawers/Drawers.qml | 3 ++- modules/drawers/Interactions.qml | 7 +++++++ modules/drawers/Panels.qml | 11 +++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) (limited to 'modules/drawers') diff --git a/modules/drawers/Backgrounds.qml b/modules/drawers/Backgrounds.qml index 3e0156f..a78c667 100644 --- a/modules/drawers/Backgrounds.qml +++ b/modules/drawers/Backgrounds.qml @@ -4,6 +4,7 @@ import "root:/modules/osd" as Osd import "root:/modules/notifications" as Notifications import "root:/modules/session" as Session import "root:/modules/launcher" as Launcher +import "root:/modules/dashboard" as Dashboard import QtQuick.Shapes Shape { @@ -43,4 +44,11 @@ Shape { startX: (root.width - wrapper.width) / 2 startY: root.height } + + Dashboard.Background { + wrapper: panels.dashboard + + startX: (root.width - wrapper.width) / 2 + startY: 0 + } } diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml index 51374e9..91c6fc8 100644 --- a/modules/drawers/Drawers.qml +++ b/modules/drawers/Drawers.qml @@ -89,10 +89,11 @@ Variants { PersistentProperties { id: visibilities - property bool launcher property bool osd property bool notifications: Notifs.popups.length > 0 property bool session + property bool launcher + property bool dashboard Component.onCompleted: Visibilities.screens[scope.modelData] = this } diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index e937326..0dfda50 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -21,6 +21,10 @@ MouseArea { function inRightPanel(panel: Item, x: real, y: real): bool { return x > BorderConfig.thickness + panel.x && withinPanelHeight(panel, x, y); } + + function inTopPanel(panel: Item, x: real, y: real): bool { + const panelX = BorderConfig.thickness + panel.x; + return y < BorderConfig.thickness + panel.y + panel.height && x >= panelX && x <= panelX + panel.width; } anchors.fill: parent @@ -50,6 +54,9 @@ MouseArea { else if (dragX > SessionConfig.dragThreshold) root.visibilities.session = false; } + + const showDashboard = root.inTopPanel(panels.dashboard, x, y); + root.visibilities.dashboard = showDashboard; } } diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml index ab5f8de..9bde4b2 100644 --- a/modules/drawers/Panels.qml +++ b/modules/drawers/Panels.qml @@ -3,6 +3,7 @@ import "root:/modules/osd" as Osd import "root:/modules/notifications" as Notifications import "root:/modules/session" as Session import "root:/modules/launcher" as Launcher +import "root:/modules/dashboard" as Dashboard import Quickshell import QtQuick @@ -16,6 +17,7 @@ Item { readonly property Notifications.Wrapper notifications: notifications readonly property Session.Wrapper session: session readonly property Launcher.Wrapper launcher: launcher + readonly property Dashboard.Wrapper dashboard: dashboard anchors.fill: parent anchors.margins: BorderConfig.thickness @@ -58,4 +60,13 @@ Item { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom } + + Dashboard.Wrapper { + id: dashboard + + visibilities: root.visibilities + + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + } } -- cgit v1.2.3-freya