From cc97e86709dd1c6e360b653d57d22743cbdaf3a8 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Fri, 21 Mar 2025 18:56:55 +0100 Subject: [PATCH] Revert "voldisp: fix logic re hide/show widgets and how to `goAway`" This reverts commit 1fa489b918c1fa94e1756f3c2b61bb0c25da9e39. --- apps/voldisp/boot.js | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/apps/voldisp/boot.js b/apps/voldisp/boot.js index 349876d91..ef179d705 100644 --- a/apps/voldisp/boot.js +++ b/apps/voldisp/boot.js @@ -26,7 +26,6 @@ } }; - let isWeHidingTheWidgets = false; let timeout; let onMusicVolume = (volPercent)=>{ if (timeout) {clearTimeout(timeout);} @@ -34,20 +33,15 @@ if (Bangle.CLOCK) { let isAllWidgetsHidden = true; - if (!timeout) { // No need to do this if we already did it before and it wasn't undone. I.e. the timout to execute `goAway` never ran out. - if (global.WIDGETS) { - for (var w of global.WIDGETS) { - if (!w._draw) { - isAllWidgetsHidden = false; - break; - } + if (global.WIDGETS) { + for (var w of global.WIDGETS) { + if (!w._draw) { + isAllWidgetsHidden = false; + break; } } - if (!isAllWidgetsHidden) { - WIDGET_UTILS_HIDE(); - isWeHidingTheWidgets = true; // Remember if it was we who hid the widgets between draws of the volume bar. - } } + if (!timeout) {WIDGET_UTILS_HIDE();} let barWidth = g.getWidth()*volPercent/100; g. setColor(0x0000).fillRect(0,0,g.getWidth(),24). @@ -56,10 +50,9 @@ drawString("volume",barWidth,1); let goAway = ()=>{ - if (isWeHidingTheWidgets) { + if (!isAllWidgetsHidden) { g.reset().clearRect(0,0,g.getWidth(),24); WIDGET_UTILS_SHOW(); - isWeHidingTheWidgets = false; } else if (Bangle.uiRedraw) { Bangle.uiRedraw(); } else {