diff options
| author | Leander Scherer <leander@schererleander.de> | 2026-06-29 21:08:42 +0200 |
|---|---|---|
| committer | Leander Scherer <leander@schererleander.de> | 2026-06-29 21:22:33 +0200 |
| commit | 67b7245bf96cf954d90719e800cf9618ffaa4feb (patch) | |
| tree | 2723c3db278840150985cdc630487ff175d330d9 /modules/system/quickshell/Media.qml | |
| parent | d4fa3d0533c8dac688e38413403815de1802339e (diff) | |
chore: cleanup sway, quickshell
Diffstat (limited to 'modules/system/quickshell/Media.qml')
| -rw-r--r-- | modules/system/quickshell/Media.qml | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/modules/system/quickshell/Media.qml b/modules/system/quickshell/Media.qml deleted file mode 100644 index f16207c..0000000 --- a/modules/system/quickshell/Media.qml +++ /dev/null @@ -1,107 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import Quickshell -import Quickshell.Services.Mpris - -Item { - id: root - - property QtObject manualExpandedPlayer: null - - readonly property var activePlayers: Mpris.players?.values || [] - - readonly property var expandedPlayer: { - if (root.manualExpandedPlayer !== null && root.activePlayers.includes(root.manualExpandedPlayer)) { - return root.manualExpandedPlayer; - } - for (const player of root.activePlayers) { - if (player.playbackState === MprisPlaybackState.Playing) { - return player; - } - } - if (root.activePlayers.length > 0) { - return root.activePlayers[0]; - } - return null; - } - - width: childrenRect.width - height: parent.height - - Row { - anchors.verticalCenter: parent.verticalCenter - - MusicVisualizer { - active: root.expandedPlayer?.playbackState === MprisPlaybackState.Playing - anchors.verticalCenter: parent.verticalCenter - } - } - - MouseArea { - anchors.fill: parent - onClicked: GlobalState.toggle("Media") - } - - AnchoredPopup { - popupName: "Media" - anchorWindow: barWindow - anchorItem: root - - PopupCard { - id: card - width: 320 - - ColumnLayout { - Layout.fillWidth: true - spacing: 0 - Layout.margins: 8 - - Repeater { - model: root.activePlayers.length > 0 ? root.activePlayers : [null] - - delegate: Item { - id: playerDelegate - Layout.fillWidth: true - implicitHeight: mediaCard.implicitHeight + (separator.visible ? separator.height + 16 : 0) - - required property var modelData - required property int index - - readonly property bool isEmpty: modelData === null - readonly property bool isExpanded: root.expandedPlayer === modelData && !isEmpty - - ColumnLayout { - anchors.fill: parent - spacing: 16 - - MediaCard { - id: mediaCard - Layout.fillWidth: true - player: playerDelegate.modelData - isExpanded: playerDelegate.isExpanded - - onClicked: { - if (!playerDelegate.isEmpty) { - root.manualExpandedPlayer = playerDelegate.modelData; - } else { - Quickshell.execDetached(["spotify"]); - } - } - } - - Rectangle { - id: separator - Layout.fillWidth: true - height: 1 - color: Theme.border - opacity: 0.3 - visible: !playerDelegate.isEmpty && playerDelegate.index < root.activePlayers.length - 1 - Layout.topMargin: 4 - } - } - } - } - } - } - } -} |
