chore: improve mpris music progress logic
This commit is contained in:
parent
7ad76c2936
commit
e9a621dbaa
3 changed files with 7 additions and 16 deletions
|
@ -15,7 +15,7 @@ PanelWindow {
|
|||
id: homeWindow
|
||||
|
||||
property bool animRunning: false
|
||||
required property bool focused
|
||||
property bool focused: false
|
||||
property bool focusLocked: false
|
||||
|
||||
color: "transparent"
|
||||
|
@ -114,6 +114,7 @@ PanelWindow {
|
|||
height: 100
|
||||
}
|
||||
|
||||
MprisSmall {}
|
||||
GridLayout {
|
||||
|
||||
rows: 2
|
||||
|
@ -147,7 +148,6 @@ PanelWindow {
|
|||
height: 30
|
||||
}
|
||||
}
|
||||
MprisSmall {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.I3
|
||||
import "provider"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
@ -14,12 +13,12 @@ Item {
|
|||
|
||||
Component.onCompleted: {
|
||||
I3.focusedMonitorChanged.connect(e => {
|
||||
dash.focused = I3.monitorFor(root.screen).focused;
|
||||
dash.focused = I3.monitorFor(root.screen)?.focused;
|
||||
});
|
||||
}
|
||||
|
||||
property Dashboard dash: Dashboard {
|
||||
screen: root.screen
|
||||
focused: I3.monitorFor(root.screen).focused
|
||||
focused: I3.monitorFor(root.screen)?.focused ?? true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,18 +129,10 @@ BRectangle {
|
|||
enabled: (card.player?.canSeek && card.player?.positionSupported) ?? false
|
||||
|
||||
onMoved: {
|
||||
if (card.player)
|
||||
if (card.player) {
|
||||
card.player.position = value;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
const con = () => card.player?.positionChanged.connect(() => {
|
||||
slider.value = card.player?.position;
|
||||
});
|
||||
con();
|
||||
Player.currentChanged.connect(() => {
|
||||
con();
|
||||
});
|
||||
value = card.player.position;
|
||||
}
|
||||
}
|
||||
|
||||
FrameAnimation {
|
||||
|
|
Loading…
Add table
Reference in a new issue