workspace view rework
This commit is contained in:
@@ -31,9 +31,11 @@ Singleton {
|
||||
property string lastActivePlayerIdentify: "";
|
||||
|
||||
onReloaded: {
|
||||
root.setActivePlayerFromIdentity(lastActivePlayerIdentify)
|
||||
root.updateActiveTrackPosition()
|
||||
}
|
||||
onLoaded: {
|
||||
root.setActivePlayerFromIdentity(lastActivePlayerIdentify)
|
||||
root.updateActiveTrackPosition()
|
||||
}
|
||||
}
|
||||
@@ -166,6 +168,15 @@ Singleton {
|
||||
this.activePlayer = player;
|
||||
}
|
||||
|
||||
function setActivePlayerFromIdentity(identify: string) {
|
||||
for (x in root.mpris.players) {
|
||||
if (x.identify == identify) {
|
||||
this.activePlayer = x
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
// only emit the signal when the position is actually changing.
|
||||
running: root.activePlayer.playbackState == MprisPlaybackState.Playing
|
||||
|
||||
Reference in New Issue
Block a user