Compare commits
2 commits
2852735d70
...
00a46ac6ec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00a46ac6ec | ||
|
|
e75c86e056 |
3 changed files with 14 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import "components"
|
import "components"
|
||||||
|
import "components/mpris"
|
||||||
import "../../config/"
|
import "../../config/"
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int currentIndex: 0
|
property int currentIndex: 0
|
||||||
|
property var players: Mpris.players
|
||||||
|
|
||||||
implicitWidth: childrenRect.width
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
implicitHeight: childrenRect.height
|
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: players
|
id: players
|
||||||
|
|
@ -16,6 +16,9 @@ Item {
|
||||||
|
|
||||||
Player {
|
Player {
|
||||||
|
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
visible: index === root.currentIndex && modelData.canControl
|
visible: index === root.currentIndex && modelData.canControl
|
||||||
|
|
||||||
onNextPlayer: {
|
onNextPlayer: {
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Services.Mpris
|
import Quickshell.Services.Mpris
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import "../../../styled/"
|
import "../../../../styled/"
|
||||||
import "../../../config/"
|
import "../../../../config/"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
required property MprisPlayer modelData
|
required property MprisPlayer modelData
|
||||||
required property int index
|
required property int index
|
||||||
|
|
||||||
signal nextPlayer()
|
signal nextPlayer
|
||||||
signal previousPlayer()
|
signal previousPlayer
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
implicitWidth: text.width
|
||||||
implicitWidth: childrenRect.width
|
|
||||||
implicitHeight: Dimensions.mpris.height
|
implicitHeight: Dimensions.mpris.height
|
||||||
|
|
||||||
StyledLabel {
|
StyledLabel {
|
||||||
anchors.fill: parent
|
anchors.fill: text
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
id: text
|
||||||
text: `${modelData.isPlaying ? "" : ""} ${modelData.trackTitle} - ${modelData.trackArtist}`
|
text: `${modelData.isPlaying ? "" : ""} ${modelData.trackTitle} - ${modelData.trackArtist}`
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
@ -32,7 +32,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: text
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!modelData.canTogglePlaying) {
|
if (!modelData.canTogglePlaying) {
|
||||||
Loading…
Add table
Reference in a new issue