fix dashboard display and player switch
This commit is contained in:
parent
0a33022c6a
commit
d42b7cb612
2 changed files with 46 additions and 41 deletions
|
|
@ -7,15 +7,18 @@ import qs.services
|
||||||
import qs.widgets
|
import qs.widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
StyledDrawer {
|
StyledDrawer {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
visible: Visibility.dashboard
|
visible: Visibility.dashboard
|
||||||
|
|
||||||
margins: 20
|
WrapperRectangle {
|
||||||
contentItem: ColumnLayout {
|
color: Theme.palette.base300
|
||||||
|
radius: 8
|
||||||
|
margin: 20
|
||||||
|
ColumnLayout {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
|
|
@ -60,4 +63,5 @@ StyledDrawer {
|
||||||
player: Mpris.active
|
player: Mpris.active
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,14 @@ Singleton {
|
||||||
if (players.length == 0) {
|
if (players.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
properties.currentIndex = properties.currentIndex + 1 % players.length;
|
properties.currentIndex = (properties.currentIndex + 1) % players.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
function previousPlayer() {
|
function previousPlayer() {
|
||||||
if (players.length == 0) {
|
if (players.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
properties.currentIndex = properties.currentIndex - 1 % players.length;
|
const newIndex = properties.currentIndex - 1;
|
||||||
|
properties.currentIndex = newIndex >= 0 ? newIndex : players.length - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue