From a0a29037060cd84212a49d68e03ffb6cd30eb6a0 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sun, 9 Jul 2023 23:23:18 +0100 Subject: [PATCH] Make updating of clock backgrounds more efficient --- app/musicmuster.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/musicmuster.py b/app/musicmuster.py index e53e120..e550e3c 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -1746,15 +1746,15 @@ class Window(QMainWindow, Ui_MainWindow): # If silent in the next 5 seconds, put warning colour on # time to silence box and enable play controls if time_to_silence <= 5500: - self.frame_silent.setStyleSheet( - f"background: {Config.COLOUR_ENDING_TIMER}" - ) + css_silence = f"background: {Config.COLOUR_ENDING_TIMER}" + if self.frame_silent.styleSheet() != css_silence: + self.frame_silent.setStyleSheet(css_silence) self.enable_play_next_controls() # Set warning colour on time to silence box when fade starts elif time_to_fade <= 500: - self.frame_silent.setStyleSheet( - f"background: {Config.COLOUR_WARNING_TIMER}" - ) + css_fade = f"background: {Config.COLOUR_WARNING_TIMER}" + if self.frame_silent.styleSheet() != css_fade: + self.frame_silent.setStyleSheet(css_fade) # Five seconds before fade starts, set warning colour on # time to silence box and enable play controls elif time_to_fade <= 5500: