wrap mpris player selection pills into multiple rows with Flow
This commit is contained in:
parent
1b6c2fee91
commit
22ca356fb5
1 changed files with 35 additions and 43 deletions
|
|
@ -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
|
||||||
|
|
@ -363,5 +356,4 @@ Column {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue