Revert "voldisp: some optimization"

This reverts commit 500296af19.
master
thyttan 2025-03-21 18:59:22 +01:00
parent cc97e86709
commit 108a932a58
1 changed files with 29 additions and 30 deletions

View File

@ -1,4 +1,10 @@
{
let timeout;
let onMusicVolume = (volPercent)=>{
if (timeout) {clearTimeout(timeout); timeout=undefined;}
if (Bangle.CLOCK) {
const WIDGET_UTILS_HIDE = function() {
//exports.cleanup();
if (!global.WIDGETS) return;
@ -26,12 +32,6 @@
}
};
let timeout;
let onMusicVolume = (volPercent)=>{
if (timeout) {clearTimeout(timeout);}
if (Bangle.CLOCK) {
let isAllWidgetsHidden = true;
if (global.WIDGETS) {
for (var w of global.WIDGETS) {
@ -41,7 +41,7 @@
}
}
}
if (!timeout) {WIDGET_UTILS_HIDE();}
WIDGET_UTILS_HIDE();
let barWidth = g.getWidth()*volPercent/100;
g.
setColor(0x0000).fillRect(0,0,g.getWidth(),24).
@ -58,7 +58,6 @@
} else {
Bangle.load();
}
timeout = undefined;
};
timeout = setTimeout(goAway, 3*1000);
}