diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-05 16:52:33 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-05 16:52:33 +1000 |
| commit | b8a22eaa28f5ce936d17d38043c9cf00fdf95b07 (patch) | |
| tree | 43d49f9fb4e6a4620b5c980c63b1b10f5639be7c /modules/dashboard/dash/Media.qml | |
| parent | dashboard: media player selector elide text (diff) | |
| download | caelestia-shell-b8a22eaa28f5ce936d17d38043c9cf00fdf95b07.tar.gz caelestia-shell-b8a22eaa28f5ce936d17d38043c9cf00fdf95b07.tar.bz2 caelestia-shell-b8a22eaa28f5ce936d17d38043c9cf00fdf95b07.zip | |
dashboard: dont update pane if not current
Diffstat (limited to 'modules/dashboard/dash/Media.qml')
| -rw-r--r-- | modules/dashboard/dash/Media.qml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/dashboard/dash/Media.qml b/modules/dashboard/dash/Media.qml index ec72d03..7122d69 100644 --- a/modules/dashboard/dash/Media.qml +++ b/modules/dashboard/dash/Media.qml @@ -10,6 +10,8 @@ import QtQuick.Shapes Item { id: root + required property bool shouldUpdate + property real playerProgress: { const active = Players.active; return active?.length ? active.position / active.length : 0; @@ -28,7 +30,7 @@ Item { } Timer { - running: root.visible && (Players.active?.isPlaying ?? false) + running: root.shouldUpdate && (Players.active?.isPlaying ?? false) interval: DashboardConfig.mediaUpdateInterval triggeredOnStart: true repeat: true @@ -218,7 +220,7 @@ Item { anchors.bottomMargin: Appearance.padding.large anchors.margins: Appearance.padding.large * 2 - playing: visible && (Players.active?.isPlaying ?? false) + playing: root.shouldUpdate && (Players.active?.isPlaying ?? false) speed: BeatDetector.bpm / 300 source: "root:/assets/bongocat.gif" asynchronous: true |