dashboard: fix player selector icons
This commit is contained in:
parent
6b9b91dbe2
commit
5bddb40b3e
1 changed files with 7 additions and 6 deletions
|
|
@ -395,7 +395,7 @@ Item {
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
PlayerIcon {
|
PlayerIcon {
|
||||||
identity: Players.active?.identity ?? ""
|
player: Players.active
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -451,6 +451,7 @@ Item {
|
||||||
required property MprisPlayer modelData
|
required property MprisPlayer modelData
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.minimumWidth: playerSelector.implicitWidth
|
||||||
implicitWidth: playerInner.implicitWidth + Appearance.padding.normal * 2
|
implicitWidth: playerInner.implicitWidth + Appearance.padding.normal * 2
|
||||||
implicitHeight: playerInner.implicitHeight + Appearance.padding.smaller * 2
|
implicitHeight: playerInner.implicitHeight + Appearance.padding.smaller * 2
|
||||||
|
|
||||||
|
|
@ -470,7 +471,7 @@ Item {
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
PlayerIcon {
|
PlayerIcon {
|
||||||
identity: player.modelData.identity
|
player: player.modelData
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -546,12 +547,12 @@ Item {
|
||||||
component PlayerIcon: Loader {
|
component PlayerIcon: Loader {
|
||||||
id: loader
|
id: loader
|
||||||
|
|
||||||
required property string identity
|
required property MprisPlayer player
|
||||||
readonly property string icon: Icons.getAppIcon(identity)
|
readonly property string icon: Icons.getAppIcon(player?.identity)
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
sourceComponent: icon === "image://icon/" ? fallbackIcon : playerImage
|
sourceComponent: !player || icon === "image://icon/" ? fallbackIcon : playerImage
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: playerImage
|
id: playerImage
|
||||||
|
|
@ -566,7 +567,7 @@ Item {
|
||||||
id: fallbackIcon
|
id: fallbackIcon
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
text: loader.identity ? "animated_images" : "music_off"
|
text: loader.player ? "animated_images" : "music_off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue