From b8a22eaa28f5ce936d17d38043c9cf00fdf95b07 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 5 Jun 2025 16:52:33 +1000 Subject: dashboard: dont update pane if not current --- modules/dashboard/Media.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/dashboard/Media.qml') diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml index 6d894af..9751572 100644 --- a/modules/dashboard/Media.qml +++ b/modules/dashboard/Media.qml @@ -14,6 +14,8 @@ import QtQuick.Effects Item { id: root + required property bool shouldUpdate + property real playerProgress: { const active = Players.active; return active?.length ? active.position / active.length : 0; @@ -39,7 +41,7 @@ Item { } Timer { - running: root.visible && (Players.active?.isPlaying ?? false) + running: root.shouldUpdate && (Players.active?.isPlaying ?? false) interval: DashboardConfig.mediaUpdateInterval triggeredOnStart: true repeat: true @@ -52,7 +54,7 @@ Item { stdout: SplitParser { onRead: data => { root.cava = data.slice(0, -1).split(";").map(v => parseInt(v, 10)); - if (visualiser.visible) + if (root.shouldUpdate) visualiser.requestPaint(); } } @@ -535,7 +537,7 @@ Item { anchors.left: details.right anchors.leftMargin: Appearance.spacing.large - playing: visible && (Players.active?.isPlaying ?? false) + playing: root.shouldUpdate && (Players.active?.isPlaying ?? false) speed: BeatDetector.bpm / 300 source: "root:/assets/bongocat.gif" asynchronous: true -- cgit v1.2.3-freya