From 9757567855df11ecd5278579af7dadfd4a8413f8 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Wed, 27 Aug 2025 23:21:48 -0400 Subject: [PATCH] more raw --- components/MprisController.qml | 132 +++++++++++------------- modules/drawers/dashboard/Dashboard.qml | 11 +- 2 files changed, 70 insertions(+), 73 deletions(-) diff --git a/components/MprisController.qml b/components/MprisController.qml index fd41afe..6443314 100644 --- a/components/MprisController.qml +++ b/components/MprisController.qml @@ -9,88 +9,82 @@ import QtQuick.Layouts import Quickshell.Services.Mpris import Quickshell.Widgets -WrapperRectangle { +ColumnLayout { id: root + required property MprisPlayer player - color: Theme.palette.base200 - radius: 8 - margin: 16 + spacing: 12 - ColumnLayout { + implicitWidth: 800 - spacing: 12 + StyledText { + id: text + Layout.alignment: Qt.AlignHCenter + text: `${root.player.trackTitle} - ${root.player.trackArtist}` + font.pixelSize: Dimensions.mpris.fontSize + } - implicitWidth: 800 - - StyledText { - id: text - Layout.alignment: Qt.AlignHCenter - text: `${root.player.trackTitle} - ${root.player.trackArtist}` - font.pixelSize: Dimensions.mpris.fontSize - } - - RowLayout { - Layout.alignment: Qt.AlignHCenter - StyledButton { - id: backButton - content: LucideIcon { - color: backButton.containsMouse ? Theme.palette.primarycontent : Theme.palette.basecontent - text: Icons.skipBack - } - onClicked: { - root.player.previous(); - } + RowLayout { + Layout.alignment: Qt.AlignHCenter + StyledButton { + id: backButton + content: LucideIcon { + color: backButton.containsMouse ? Theme.palette.primarycontent : Theme.palette.basecontent + text: Icons.skipBack } - StyledButton { - id: playPauseButton - content: LucideIcon { - color: playPauseButton.containsMouse ? Theme.palette.primarycontent : Theme.palette.basecontent - text: root.player.isPlaying ? Icons.square : Icons.play - } - onClicked: { - root.player.isPlaying = !root.player.isPlaying; - } - } - StyledButton { - id: forwardButton - content: LucideIcon { - color: forwardButton.containsMouse ? Theme.palette.primarycontent : Theme.palette.basecontent - text: Icons.skipForward - } - onClicked: { - root.player.next(); - } + onClicked: { + root.player.previous(); } } - - StyledText { - Layout.alignment: Qt.AlignHCenter - text: { - function formatTime(num) { - return Math.floor(num).toString().padStart(2, "0"); - } - return `${formatTime(root.player.position / 60)}:${formatTime(root.player.position % 60)} - ${formatTime(root.player.length / 60)}:${formatTime(root.player.length % 60)}`; + StyledButton { + id: playPauseButton + content: LucideIcon { + color: playPauseButton.containsMouse ? Theme.palette.primarycontent : Theme.palette.basecontent + text: root.player.isPlaying ? Icons.square : Icons.play + } + onClicked: { + root.player.isPlaying = !root.player.isPlaying; } - font.pixelSize: Dimensions.mpris.fontSize } - - StyledSlider { - from: 0 - to: root.player.length ?? 0 - value: root.player.position - implicitHeight: 6 - Layout.fillWidth: true - onMoved: { - root.player.position = value; + StyledButton { + id: forwardButton + content: LucideIcon { + color: forwardButton.containsMouse ? Theme.palette.primarycontent : Theme.palette.basecontent + text: Icons.skipForward } - - Timer { - running: root.player.isPlaying - interval: 1000 - repeat: true - onTriggered: root.player.positionChanged() + onClicked: { + root.player.next(); } } } + + StyledText { + Layout.alignment: Qt.AlignHCenter + text: { + function formatTime(num) { + return Math.floor(num).toString().padStart(2, "0"); + } + return `${formatTime(root.player.position / 60)}:${formatTime(root.player.position % 60)} - ${formatTime(root.player.length / 60)}:${formatTime(root.player.length % 60)}`; + } + font.pixelSize: Dimensions.mpris.fontSize + } + + StyledSlider { + from: 0 + to: root.player.length ?? 0 + value: root.player.position + implicitHeight: 6 + Layout.fillWidth: true + onMoved: { + root.player.position = value; + } + + Timer { + running: root.player.isPlaying + interval: 1000 + repeat: true + onTriggered: root.player.positionChanged() + } + } } diff --git a/modules/drawers/dashboard/Dashboard.qml b/modules/drawers/dashboard/Dashboard.qml index ab1ce02..def762f 100644 --- a/modules/drawers/dashboard/Dashboard.qml +++ b/modules/drawers/dashboard/Dashboard.qml @@ -15,11 +15,14 @@ StyledDrawer { visible: Visibility.dashboard WrapperRectangle { - color: Theme.palette.base300 + color: Theme.palette.base200 radius: 8 - margin: 20 + margin: 32 ColumnLayout { - RowLayout { + spacing: 8 + RowLayout { + spacing: 8 + Layout.alignment: Qt.AlignHCenter StyledButton { @@ -60,7 +63,7 @@ StyledDrawer { } MprisController { - player: Mpris.active + player: Mpris.active } } }