Compare commits
No commits in common. "191222aa317a2229c20d509135999dac67a4eda4" and "dddbb8298447f9da2acf8bf39a4289719525970e" have entirely different histories.
191222aa31
...
dddbb82984
4 changed files with 94 additions and 112 deletions
|
|
@ -8,15 +8,13 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import Quickshell.Services.Mpris
|
||||
|
||||
Loader {
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
required property MprisPlayer player
|
||||
|
||||
active: player != null
|
||||
|
||||
sourceComponent: ColumnLayout {
|
||||
spacing: 12
|
||||
|
||||
implicitWidth: 800
|
||||
|
||||
StyledText {
|
||||
|
|
@ -80,4 +78,3 @@ Loader {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
import qs.components
|
||||
import qs.constants
|
||||
import qs.services
|
||||
import qs.widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
RowLayout {
|
||||
spacing: 8
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
StyledIconButton {
|
||||
id: previousPlayerButton
|
||||
|
||||
visible: Mpris.players.length > 1
|
||||
text: Icons.chevronLeft
|
||||
|
||||
onClicked: {
|
||||
Mpris.previousPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
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;
|
||||
}
|
||||
font.pixelSize: 20
|
||||
}
|
||||
|
||||
StyledIconButton {
|
||||
id: nextPlayerButton
|
||||
|
||||
visible: Mpris.players.length > 1
|
||||
text: Icons.chevronRight
|
||||
|
||||
onClicked: {
|
||||
Mpris.nextPlayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.components
|
||||
import qs.constants
|
||||
import qs.services
|
||||
import qs.widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
|
@ -14,9 +16,44 @@ StyledDrawer {
|
|||
margin: 32
|
||||
ColumnLayout {
|
||||
spacing: 8
|
||||
RowLayout {
|
||||
spacing: 8
|
||||
|
||||
MprisPlayerSelector {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
StyledIconButton {
|
||||
id: previousPlayerButton
|
||||
|
||||
visible: Mpris.players.length > 1
|
||||
text: Icons.chevronLeft
|
||||
|
||||
onClicked: {
|
||||
Mpris.previousPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
if (Mpris.active?.identity) {
|
||||
const words = Mpris.active?.identity.split("-");
|
||||
const capitalized = words.map(val => String(val).charAt(0).toUpperCase() + String(val).slice(1));
|
||||
return capitalized.join(" ");
|
||||
}
|
||||
return Mpris.active?.desktopEntry ?? Mpris.active?.dbusName ?? "unknown";
|
||||
}
|
||||
font.pixelSize: 20
|
||||
}
|
||||
|
||||
StyledButton {
|
||||
id: nextPlayerButton
|
||||
visible: Mpris.players.length > 1
|
||||
|
||||
text: Icons.chevronRight
|
||||
|
||||
onClicked: {
|
||||
Mpris.nextPlayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MprisController {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Singleton {
|
|||
id: root
|
||||
|
||||
property list<MprisPlayer> players: Mpris.players.values
|
||||
property MprisPlayer active: players[properties.currentIndex] ?? null
|
||||
property MprisPlayer active: players[properties.currentIndex]
|
||||
|
||||
PersistentProperties {
|
||||
id: properties
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue