move mpris player selector
This commit is contained in:
parent
4007344d9d
commit
37afb798bc
1 changed files with 0 additions and 0 deletions
51
components/composite/MprisPlayerSelector.qml
Normal file
51
components/composite/MprisPlayerSelector.qml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import qs.config
|
||||
import qs.components
|
||||
import qs.services
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
RowLayout {
|
||||
spacing: Styling.layout.spacing.xl
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
StyledIconButton {
|
||||
id: previousPlayerButton
|
||||
|
||||
visible: Mpris.players.length > 1
|
||||
text: Styling.lucide.icons.chevronLeft
|
||||
|
||||
onClicked: {
|
||||
Mpris.previousPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
font.pixelSize: Styling.typography.textSize.xl
|
||||
text: {
|
||||
if (!Mpris.active) {
|
||||
return "inactive";
|
||||
}
|
||||
const player = Mpris.active;
|
||||
const displayName = player.identity ?? player.desktopEntry ?? player.dbusName ?? "unknown";
|
||||
if (displayName.toLowerCase().includes('tidal')) {
|
||||
return "Tidal";
|
||||
}
|
||||
if (displayName.toLowerCase().includes('zen')) {
|
||||
return "Zen";
|
||||
}
|
||||
return displayName;
|
||||
}
|
||||
}
|
||||
|
||||
StyledIconButton {
|
||||
id: nextPlayerButton
|
||||
|
||||
visible: Mpris.players.length > 1
|
||||
text: Styling.lucide.icons.chevronRight
|
||||
|
||||
onClicked: {
|
||||
Mpris.nextPlayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue