fix width issue

This commit is contained in:
Benjamin Palko 2025-07-22 09:13:43 -04:00
parent e75c86e056
commit 00a46ac6ec
2 changed files with 9 additions and 6 deletions

View file

@ -6,9 +6,9 @@ Item {
id: root
property int currentIndex: 0
property var players: Mpris.players
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
anchors.horizontalCenter: parent.horizontalCenter
Repeater {
id: players
@ -16,6 +16,9 @@ Item {
Player {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: index === root.currentIndex && modelData.canControl
onNextPlayer: {

View file

@ -11,15 +11,15 @@ Item {
signal nextPlayer
signal previousPlayer
anchors.horizontalCenter: parent.horizontalCenter
implicitWidth: childrenRect.width
implicitWidth: text.width
implicitHeight: Dimensions.mpris.height
StyledLabel {
anchors.fill: parent
anchors.fill: text
}
StyledText {
id: text
text: `${modelData.isPlaying ? "" : ""} ${modelData.trackTitle} - ${modelData.trackArtist}`
anchors.verticalCenter: parent.verticalCenter
@ -32,7 +32,7 @@ Item {
}
MouseArea {
anchors.fill: parent
anchors.fill: text
onClicked: {
if (!modelData.canTogglePlaying) {