From 7063448b8040f5b8b8b880cb4be4ccc3ee1ab70d Mon Sep 17 00:00:00 2001 From: purian23 Date: Sun, 2 Aug 2026 18:10:12 -0400 Subject: [PATCH] refactor(media OSD): add previous/next UI controls Port 1.5 (cherry picked from commit 32ddf614c3c19402b5014aec99261085ae8121ce) --- quickshell/Modules/OSD/MediaPlaybackOSD.qml | 105 ++++++++++++++++---- 1 file changed, 85 insertions(+), 20 deletions(-) diff --git a/quickshell/Modules/OSD/MediaPlaybackOSD.qml b/quickshell/Modules/OSD/MediaPlaybackOSD.qml index ddce20a66..7cfce1c4f 100644 --- a/quickshell/Modules/OSD/MediaPlaybackOSD.qml +++ b/quickshell/Modules/OSD/MediaPlaybackOSD.qml @@ -264,37 +264,102 @@ DankOSD { } } - Rectangle { - width: Theme.iconSize - height: Theme.iconSize - radius: Theme.iconSize / 2 - color: "transparent" + Row { + id: transportControls + x: parent.gap anchors.verticalCenter: parent.verticalCenter + spacing: Theme.spacingXXS - DankIcon { - anchors.centerIn: parent - name: root._displayIcon - size: Theme.iconSize - color: playPauseButton.containsMouse ? Theme.primary : Theme.surfaceText + Rectangle { + width: Theme.iconSize - 4 + height: Theme.iconSize - 4 + radius: (Theme.iconSize - 4) / 2 + anchors.verticalCenter: parent.verticalCenter + color: prevButton.containsMouse ? Theme.surfaceTextHover : "transparent" + opacity: (root.player?.canGoPrevious ?? false) ? 1 : 0.3 + + DankIcon { + anchors.centerIn: parent + name: "skip_previous" + size: Theme.iconSize - 10 + color: prevButton.containsMouse ? Theme.primary : Theme.surfaceText + } + + MouseArea { + id: prevButton + + anchors.fill: parent + hoverEnabled: true + enabled: root.player?.canGoPrevious ?? false + cursorShape: Qt.PointingHandCursor + onClicked: { + MprisController.previousOrRewind(); + root.hide(); + } + } } - MouseArea { - id: playPauseButton + Rectangle { + width: Theme.iconSize + height: Theme.iconSize + radius: Theme.iconSize / 2 + anchors.verticalCenter: parent.verticalCenter + color: "transparent" - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - onClicked: { - togglePlaying(); - root.hide(); + DankIcon { + anchors.centerIn: parent + name: root._displayIcon + size: Theme.iconSize + color: playPauseButton.containsMouse ? Theme.primary : Theme.surfaceText + } + + MouseArea { + id: playPauseButton + + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: { + togglePlaying(); + root.hide(); + } + } + } + + Rectangle { + width: Theme.iconSize - 4 + height: Theme.iconSize - 4 + radius: (Theme.iconSize - 4) / 2 + anchors.verticalCenter: parent.verticalCenter + color: nextButton.containsMouse ? Theme.surfaceTextHover : "transparent" + opacity: (root.player?.canGoNext ?? false) ? 1 : 0.3 + + DankIcon { + anchors.centerIn: parent + name: "skip_next" + size: Theme.iconSize - 10 + color: nextButton.containsMouse ? Theme.primary : Theme.surfaceText + } + + MouseArea { + id: nextButton + + anchors.fill: parent + hoverEnabled: true + enabled: root.player?.canGoNext ?? false + cursorShape: Qt.PointingHandCursor + onClicked: { + MprisController.next(); + root.hide(); + } } } } Column { - x: parent.gap * 2 + Theme.iconSize - width: parent.width - Theme.iconSize - parent.gap * 3 + x: parent.gap * 2 + transportControls.width + width: parent.width - transportControls.width - parent.gap * 3 anchors.verticalCenter: parent.verticalCenter spacing: Theme.spacingXXS