imageclock - Load widgets after first full draw

pull/2305/head
Martin Boonk 2022-11-18 22:13:07 +01:00
parent ac7986189c
commit c20a594987
1 changed files with 11 additions and 5 deletions

View File

@ -625,7 +625,15 @@ s.pl = {};
requestRefresh = false;
endPerfLog("initialDraw");
endPerfLog("fullDraw", true);
if (!Bangle.uiRemove) setUi();
if (!Bangle.uiRemove){
setUi();
let orig = Bangle.drawWidgets;
Bangle.drawWidgets = ()=>{};
Bangle.loadWidgets();
clearWidgetsDraw();
Bangle.drawWidgets = orig;
}
}).catch((e)=>{
print("Error during drawing", e);
});
@ -816,6 +824,7 @@ s.pl = {};
require("widget_utils").hide();
}
if (global.WIDGETS) clearWidgetsDraw();
handleLock(Bangle.isLocked(), true);
let setUi = function(){
@ -856,7 +865,4 @@ s.pl = {};
}
});
}
Bangle.loadWidgets();
clearWidgetsDraw();
}