From 4bd09169bdde4bc870e1484761c16fa22e08ebf3 Mon Sep 17 00:00:00 2001 From: Nydragon Date: Tue, 12 Nov 2024 01:37:33 +0100 Subject: [PATCH] chore: add wip dashboard --- src/Bar.qml | 161 +++++++++++++++++++----- src/widgets/caffeine/Caffeine.qml | 4 +- src/widgets/network/Network.qml | 2 +- src/widgets/notifcenter/Notifcenter.qml | 2 +- src/windows/audioman/AudioManager.qml | 13 +- 5 files changed, 139 insertions(+), 43 deletions(-) diff --git a/src/Bar.qml b/src/Bar.qml index 0df8c9c..760b0ca 100644 --- a/src/Bar.qml +++ b/src/Bar.qml @@ -3,64 +3,161 @@ import QtQuick // for Text import QtQuick.Layouts import "widgets/systray" import "widgets/workspaces" -import "widgets/privacy" import "widgets/battery" import "widgets/network" import "widgets/notifcenter" import "widgets/caffeine" import "windows/notificationtoast" import "windows/workspace-view" +import "base" +import QtQuick.Controls +import Quickshell.Io Scope { Variants { model: Quickshell.screens - // the screen from the screens list will be injected into this property - PanelWindow { - id: lbar + } + + Variants { + model: Quickshell.screens + delegate: Item { + id: root + property var modelData - screen: modelData + property bool enabled: false - anchors { - top: true - left: true - bottom: true - } - margins.left: 2 - margins.top: 2 - margins.bottom: 2 + PanelWindow { + id: lbar + screen: root.modelData - width: 30 - color: "transparent" - NotificationToasts { - win: lbar + anchors { + top: true + left: true + bottom: true + } + margins.left: 2 + margins.top: 2 + margins.bottom: 2 + + width: 30 + color: "transparent" + + NotificationToasts { + win: lbar + } + + WorkspaceView {} + + Rectangle { + color: "transparent" + anchors.margins: 5 + + height: parent.height + width: parent.width + + ColumnLayout { + width: 30 + Layout.maximumWidth: 30 + + // TODO: on click open a calendar view + ClockWidget {} + + AudioOutput {} + + SysTray {} + + Workspaces {} + + Battery {} + + //Privacy {} + + Network {} + + Notifcenter {} + + Caffeine {} + + Item { + Layout.fillHeight: true + } + } + MouseArea { + id: mouse + onClicked: () => root.enabled = !root.enabled + height: width + width: 30 + anchors.bottom: parent.bottom + cursorShape: Qt.PointingHandCursor + BRectangle { + anchors.fill: parent + Rectangle { + visible: mouse.containsMouse + anchors.fill: parent + radius: parent.radius + color: "#9F9F9FC8" + } + } + } + } } - WorkspaceView {} + PanelWindow { + id: homeWindow - ColumnLayout { - anchors.fill: parent + property bool animRunning: false - // TODO: on click open a calendar view - ClockWidget {} + screen: root.modelData - AudioOutput {} + IpcHandler { + target: "dash" - SysTray {} + function toggle() { + root.enabled = !root.enabled; + } + } - Workspaces {} + color: "transparent" + anchors { + top: true + left: true + bottom: true + right: true + } - Battery {} + visible: animRunning || root.enabled + focusable: true + MouseArea { + anchors.fill: parent + onClicked: () => root.enabled = false - //Privacy {} + BRectangle { + id: home - Network {} + property var maxSize: 0 - Notifcenter {} + bottomRightRadius: 10 + topRightRadius: 10 + border.color: "transparent" + height: parent.height + width: root.enabled ? maxSize : 0 - Caffeine {} + MouseArea { + anchors.fill: parent + } - Item { - Layout.fillHeight: true + Component.onCompleted: () => maxSize = homeWindow.screen.width * (2 / 7) + + Behavior on width { + PropertyAnimation { + id: anim + duration: 100 + Component.onCompleted: () => { + homeWindow.animRunning = Qt.binding(() => anim.running); + } + } + } + } } } } diff --git a/src/widgets/caffeine/Caffeine.qml b/src/widgets/caffeine/Caffeine.qml index cd104cb..165cd9c 100644 --- a/src/widgets/caffeine/Caffeine.qml +++ b/src/widgets/caffeine/Caffeine.qml @@ -1,5 +1,5 @@ -import "root:base" -import "root:provider" +import "../../base" +import "../../provider" import QtQuick import Quickshell.Widgets diff --git a/src/widgets/network/Network.qml b/src/widgets/network/Network.qml index 5d79cf0..c7e6b9d 100644 --- a/src/widgets/network/Network.qml +++ b/src/widgets/network/Network.qml @@ -1,4 +1,4 @@ -import "root:base" +import "../../base" import QtQuick import Quickshell.Io import Quickshell.Widgets diff --git a/src/widgets/notifcenter/Notifcenter.qml b/src/widgets/notifcenter/Notifcenter.qml index dfec585..3e988f2 100644 --- a/src/widgets/notifcenter/Notifcenter.qml +++ b/src/widgets/notifcenter/Notifcenter.qml @@ -1,4 +1,4 @@ -import "root:base" +import "../../base" import Quickshell import Quickshell.Widgets import Quickshell.Io diff --git a/src/windows/audioman/AudioManager.qml b/src/windows/audioman/AudioManager.qml index 9a69ff0..d0f8873 100644 --- a/src/windows/audioman/AudioManager.qml +++ b/src/windows/audioman/AudioManager.qml @@ -9,11 +9,11 @@ import "root:provider" import QtQuick.Effects import "root:widgets/MprisBig" -PopupWindow { +PanelWindow { id: audioman - anchor { - rect.x: lbar.width * 1.2 - window: lbar + anchors { + top: true + left: true } color: "transparent" @@ -28,9 +28,8 @@ PopupWindow { BRectangle { id: display - x: lbar.width * 1.2 - y: lbar.width * 0.2 - + x: 10 + y: 10 width: 500 height: 600 radius: 10