initial commit
This commit is contained in:
30
bar/Music.qml
Normal file
30
bar/Music.qml
Normal file
@@ -0,0 +1,30 @@
|
||||
import QtQuick
|
||||
import Quickshell.Services.Mpris
|
||||
|
||||
Text {
|
||||
required property MprisPlayer player
|
||||
text: `${player.trackTitle} - ${player.trackArtist || "Unknown Artist"}`
|
||||
|
||||
color: "white"
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
parent.player.canGoNext && parent.player.next()
|
||||
} else if (mouse.button === Qt.LeftButton) {
|
||||
parent.player.canTogglePlaying && parent.player.togglePlaying()
|
||||
}
|
||||
}
|
||||
|
||||
onWheel: (event) => {
|
||||
if (!parent.player.volumeSupported || !parent.player.canControl){
|
||||
return
|
||||
}
|
||||
|
||||
parent.player.volume = parent.player.volume + (event.angleDelta.y / 120 * 0.05)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user