32 lines
916 B
QML
32 lines
916 B
QML
import QtQuick
|
|
import Quickshell.Services.Mpris
|
|
import "." as M
|
|
|
|
Row {
|
|
id: root
|
|
spacing: 4
|
|
visible: player !== null
|
|
|
|
readonly property MprisPlayer player: Mpris.players.values[0] ?? null
|
|
readonly property bool playing: player?.playbackState === MprisPlaybackState.Playing
|
|
|
|
Text {
|
|
text: root.playing ? "" : (root.player?.playbackState === MprisPlaybackState.Paused ? "" : "")
|
|
color: M.Theme.base05
|
|
font.pixelSize: M.Theme.fontSize + 1
|
|
font.family: M.Theme.fontFamily
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
Text {
|
|
text: root.player?.identity ?? ""
|
|
color: M.Theme.base05
|
|
font.pixelSize: M.Theme.fontSize
|
|
font.family: M.Theme.fontFamily
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
onClicked: root.player?.togglePlaying()
|
|
}
|
|
}
|