diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-03-16 10:07:32 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-16 10:07:32 -0400 |
| commit | fc60c4aacf4189188bf566219d38cb2dab4704d8 (patch) | |
| tree | 3098f974ed4cfd7090c47db6de053d59e976f65d /modules/dashboard | |
| parent | fix build (diff) | |
| download | caelestia-shell-fc60c4aacf4189188bf566219d38cb2dab4704d8.tar.gz caelestia-shell-fc60c4aacf4189188bf566219d38cb2dab4704d8.tar.bz2 caelestia-shell-fc60c4aacf4189188bf566219d38cb2dab4704d8.zip | |
simplify dashboard
Diffstat (limited to 'modules/dashboard')
| -rw-r--r-- | modules/dashboard/Dash.qml | 69 | ||||
| -rw-r--r-- | modules/dashboard/dash/DateTime.qml | 65 | ||||
| -rw-r--r-- | modules/dashboard/dash/Resources.qml | 87 | ||||
| -rw-r--r-- | modules/dashboard/dash/User.qml | 105 | ||||
| -rw-r--r-- | modules/dashboard/dash/Weather.qml | 57 |
5 files changed, 5 insertions, 378 deletions
diff --git a/modules/dashboard/Dash.qml b/modules/dashboard/Dash.qml index 7617ed8..df01166 100644 --- a/modules/dashboard/Dash.qml +++ b/modules/dashboard/Dash.qml @@ -5,60 +5,17 @@ import "dash" import Quickshell import QtQuick.Layouts -GridLayout { +RowLayout { id: root required property PersistentProperties visibilities required property PersistentProperties state - rowSpacing: Appearance.spacing.normal - columnSpacing: Appearance.spacing.normal + spacing: Appearance.spacing.normal Rect { - Layout.column: 2 - Layout.columnSpan: 3 - Layout.preferredWidth: user.implicitWidth - Layout.preferredHeight: user.implicitHeight - - radius: Appearance.rounding.large - - User { - id: user - - visibilities: root.visibilities - state: root.state - } - } - - Rect { - Layout.row: 0 - Layout.columnSpan: 2 - Layout.preferredWidth: Config.dashboard.sizes.weatherWidth - Layout.fillHeight: true - - radius: Appearance.rounding.large * 1.5 - - Weather {} - } - - Rect { - Layout.row: 1 - Layout.preferredWidth: dateTime.implicitWidth - Layout.fillHeight: true - - radius: Appearance.rounding.normal - - DateTime { - id: dateTime - } - } - - Rect { - Layout.row: 1 - Layout.column: 1 - Layout.columnSpan: 3 - Layout.fillWidth: true - Layout.preferredHeight: calendar.implicitHeight + Layout.preferredWidth: Config.dashboard.sizes.calandarWidth + Layout.preferredHeight: Config.dashboard.sizes.dashboardHeight radius: Appearance.rounding.large @@ -70,24 +27,8 @@ GridLayout { } Rect { - Layout.row: 1 - Layout.column: 4 - Layout.preferredWidth: resources.implicitWidth - Layout.fillHeight: true - - radius: Appearance.rounding.normal - - Resources { - id: resources - } - } - - Rect { - Layout.row: 0 - Layout.column: 5 - Layout.rowSpan: 2 Layout.preferredWidth: media.implicitWidth - Layout.fillHeight: true + Layout.preferredHeight: Config.dashboard.sizes.dashboardHeight radius: Appearance.rounding.large * 2 diff --git a/modules/dashboard/dash/DateTime.qml b/modules/dashboard/dash/DateTime.qml deleted file mode 100644 index e740448..0000000 --- a/modules/dashboard/dash/DateTime.qml +++ /dev/null @@ -1,65 +0,0 @@ -pragma ComponentBehavior: Bound - -import qs.components -import qs.services -import qs.config -import QtQuick -import QtQuick.Layouts - -Item { - id: root - - anchors.top: parent.top - anchors.bottom: parent.bottom - implicitWidth: Config.dashboard.sizes.dateTimeWidth - - ColumnLayout { - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - spacing: 0 - - StyledText { - Layout.bottomMargin: -(font.pointSize * 0.4) - Layout.alignment: Qt.AlignHCenter - text: Time.hourStr - color: Colours.palette.m3secondary - font.pointSize: Appearance.font.size.extraLarge - font.family: Appearance.font.family.clock - font.weight: 600 - } - - StyledText { - Layout.alignment: Qt.AlignHCenter - text: "•••" - color: Colours.palette.m3primary - font.pointSize: Appearance.font.size.extraLarge * 0.9 - font.family: Appearance.font.family.clock - } - - StyledText { - Layout.topMargin: -(font.pointSize * 0.4) - Layout.alignment: Qt.AlignHCenter - text: Time.minuteStr - color: Colours.palette.m3secondary - font.pointSize: Appearance.font.size.extraLarge - font.family: Appearance.font.family.clock - font.weight: 600 - } - - Loader { - Layout.alignment: Qt.AlignHCenter - - active: Config.services.useTwelveHourClock - visible: active - - sourceComponent: StyledText { - text: Time.amPmStr - color: Colours.palette.m3primary - font.pointSize: Appearance.font.size.large - font.family: Appearance.font.family.clock - font.weight: 600 - } - } - } -} diff --git a/modules/dashboard/dash/Resources.qml b/modules/dashboard/dash/Resources.qml deleted file mode 100644 index 7f44a9d..0000000 --- a/modules/dashboard/dash/Resources.qml +++ /dev/null @@ -1,87 +0,0 @@ -import qs.components -import qs.components.misc -import qs.services -import qs.config -import QtQuick - -Row { - id: root - - anchors.top: parent.top - anchors.bottom: parent.bottom - - padding: Appearance.padding.large - spacing: Appearance.spacing.normal - - Ref { - service: SystemUsage - } - - Resource { - icon: "memory" - value: SystemUsage.cpuPerc - colour: Colours.palette.m3primary - } - - Resource { - icon: "memory_alt" - value: SystemUsage.memPerc - colour: Colours.palette.m3secondary - } - - Resource { - icon: "hard_disk" - value: SystemUsage.storagePerc - colour: Colours.palette.m3tertiary - } - - component Resource: Item { - id: res - - required property string icon - required property real value - required property color colour - - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.margins: Appearance.padding.large - implicitWidth: icon.implicitWidth - - StyledRect { - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.top - anchors.bottom: icon.top - anchors.bottomMargin: Appearance.spacing.small - - implicitWidth: Config.dashboard.sizes.resourceProgessThickness - - color: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2) - radius: Appearance.rounding.full - - StyledRect { - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - implicitHeight: res.value * parent.height - - color: res.colour - radius: Appearance.rounding.full - } - } - - MaterialIcon { - id: icon - - anchors.bottom: parent.bottom - - text: res.icon - color: res.colour - } - - Behavior on value { - Anim { - duration: Appearance.anim.durations.large - } - } - } -} diff --git a/modules/dashboard/dash/User.qml b/modules/dashboard/dash/User.qml deleted file mode 100644 index 0d40873..0000000 --- a/modules/dashboard/dash/User.qml +++ /dev/null @@ -1,105 +0,0 @@ -import qs.components -import qs.components.effects -import qs.services -import qs.config -import qs.utils -import Quickshell -import QtQuick - -Row { - id: root - - required property PersistentProperties visibilities - required property PersistentProperties state - - padding: Appearance.padding.large - spacing: Appearance.spacing.normal - - Column { - id: info - - anchors.verticalCenter: parent.verticalCenter - spacing: Appearance.spacing.normal - - Item { - id: line - - implicitWidth: icon.implicitWidth + text.width + text.anchors.leftMargin - implicitHeight: Math.max(icon.implicitHeight, text.implicitHeight) - - ColouredIcon { - id: icon - - anchors.left: parent.left - anchors.leftMargin: (Config.dashboard.sizes.infoIconSize - implicitWidth) / 2 - - source: SysInfo.osLogo - implicitSize: Math.floor(Appearance.font.size.normal * 1.34) - colour: Colours.palette.m3primary - } - - StyledText { - id: text - - anchors.verticalCenter: icon.verticalCenter - anchors.left: icon.right - anchors.leftMargin: icon.anchors.leftMargin - text: `: ${SysInfo.osPrettyName || SysInfo.osName}` - font.pointSize: Appearance.font.size.normal - - width: Config.dashboard.sizes.infoWidth - elide: Text.ElideRight - } - } - - InfoLine { - icon: "select_window_2" - text: SysInfo.wm - colour: Colours.palette.m3secondary - } - - InfoLine { - id: uptime - - icon: "timer" - text: qsTr("up %1").arg(SysInfo.uptime) - colour: Colours.palette.m3tertiary - } - } - - component InfoLine: Item { - id: line - - required property string icon - required property string text - required property color colour - - implicitWidth: icon.implicitWidth + text.width + text.anchors.leftMargin - implicitHeight: Math.max(icon.implicitHeight, text.implicitHeight) - - MaterialIcon { - id: icon - - anchors.left: parent.left - anchors.leftMargin: (Config.dashboard.sizes.infoIconSize - implicitWidth) / 2 - - fill: 1 - text: line.icon - color: line.colour - font.pointSize: Appearance.font.size.normal - } - - StyledText { - id: text - - anchors.verticalCenter: icon.verticalCenter - anchors.left: icon.right - anchors.leftMargin: icon.anchors.leftMargin - text: `: ${line.text}` - font.pointSize: Appearance.font.size.normal - - width: Config.dashboard.sizes.infoWidth - elide: Text.ElideRight - } - } -} diff --git a/modules/dashboard/dash/Weather.qml b/modules/dashboard/dash/Weather.qml deleted file mode 100644 index c90ccf0a..0000000 --- a/modules/dashboard/dash/Weather.qml +++ /dev/null @@ -1,57 +0,0 @@ -import qs.components -import qs.services -import qs.config -import qs.utils -import QtQuick - -Item { - id: root - - anchors.centerIn: parent - - implicitWidth: icon.implicitWidth + info.implicitWidth + info.anchors.leftMargin - - Component.onCompleted: Weather.reload() - - MaterialIcon { - id: icon - - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - - animate: true - text: Weather.icon - color: Colours.palette.m3secondary - font.pointSize: Appearance.font.size.extraLarge * 2 - } - - Column { - id: info - - anchors.verticalCenter: parent.verticalCenter - anchors.left: icon.right - anchors.leftMargin: Appearance.spacing.large - - spacing: Appearance.spacing.small - - StyledText { - anchors.horizontalCenter: parent.horizontalCenter - - animate: true - text: Weather.temp - color: Colours.palette.m3primary - font.pointSize: Appearance.font.size.extraLarge - font.weight: 500 - } - - StyledText { - anchors.horizontalCenter: parent.horizontalCenter - - animate: true - text: Weather.description - - elide: Text.ElideRight - width: Math.min(implicitWidth, root.parent.width - icon.implicitWidth - info.anchors.leftMargin - Appearance.padding.large * 2) - } - } -} |