wrap mpris player selection pills into multiple rows with Flow

This commit is contained in:
Damocles 2026-04-18 14:21:00 +02:00
parent 1b6c2fee91
commit 22ca356fb5

View file

@ -306,20 +306,14 @@ Column {
// Player switcher // Player switcher
Item { Item {
width: root.width width: root.width
height: root.players.length > 1 ? 28 : 0 height: root.players.length > 1 ? _playerFlow.implicitHeight + 6 : 0
visible: root.players.length > 1 visible: root.players.length > 1
Flickable { Flow {
id: _switcher id: _playerFlow
anchors.centerIn: parent anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(_playerRow.implicitWidth, parent.width - 16) anchors.verticalCenter: parent.verticalCenter
height: 22 width: parent.width - 16
contentWidth: _playerRow.implicitWidth
clip: true
Row {
id: _playerRow
height: 22
spacing: 6 spacing: 6
Repeater { Repeater {
@ -337,7 +331,6 @@ Column {
color: _active ? S.Theme.base02 : (pHover.hovered ? S.Theme.base02 : "transparent") color: _active ? S.Theme.base02 : (pHover.hovered ? S.Theme.base02 : "transparent")
border.color: _active ? root.accentColor : S.Theme.base03 border.color: _active ? root.accentColor : S.Theme.base03
border.width: _active ? 1 : 0 border.width: _active ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
Text { Text {
id: _pLabel id: _pLabel
@ -364,4 +357,3 @@ Column {
} }
} }
} }
}