use widget_utils

master
thyttan 2023-01-11 19:20:14 +01:00
parent 88fef317e5
commit 97bae5422f
3 changed files with 9 additions and 7 deletions

View File

@ -29,3 +29,4 @@
clkinfo.addInteractive that would cause ReferenceError. clkinfo.addInteractive that would cause ReferenceError.
0.28: Option to show (1) time only and (2) week of year. 0.28: Option to show (1) time only and (2) week of year.
0.29: use setItem of clockInfoMenu to change the active item 0.29: use setItem of clockInfoMenu to change the active item
0.30: Use widget_utils.

View File

@ -6,7 +6,7 @@
const locale = require('locale'); const locale = require('locale');
const storage = require('Storage'); const storage = require('Storage');
const clock_info = require("clock_info"); const clock_info = require("clock_info");
const widget_utils = require("widget_utils");
/************************************************ /************************************************
* Globals * Globals
@ -277,9 +277,9 @@ let drawLock = function() {
let drawWidgets = function() { let drawWidgets = function() {
if(isFullscreen()){ if(isFullscreen()){
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";} widget_utils.hide();
} else { } else {
Bangle.drawWidgets(); Bangle.drawWidgets(); // Should this be replaced with widget_utils.show(); ?
} }
}; };
@ -318,7 +318,7 @@ let lockListenerBw = function(isLocked) {
if(!isLocked && settings.screen.toLowerCase() == "dynamic"){ if(!isLocked && settings.screen.toLowerCase() == "dynamic"){
// If we have to show the widgets again, we load it from our // If we have to show the widgets again, we load it from our
// cache and not through Bangle.loadWidgets as its much faster! // cache and not through Bangle.loadWidgets as its much faster!
for (let wd of WIDGETS) {wd.draw=wd._draw;wd.area=wd._area;} widget_utils.show();
} }
draw(); draw();
@ -370,7 +370,8 @@ Bangle.loadWidgets();
// Cache draw function for dynamic screen to hide / show widgets // Cache draw function for dynamic screen to hide / show widgets
// Bangle.loadWidgets() could also be called later on but its much slower! // Bangle.loadWidgets() could also be called later on but its much slower!
for (let wd of WIDGETS) {wd._draw=wd.draw; wd._area=wd.area;} //for (let wd of WIDGETS) {wd._draw=wd.draw; wd._area=wd.area;} // Not sure how to replace this or if it should just be dropped?
widget_utils.show(); // I replace with this to begin with, should I just delete it?
// Draw first time // Draw first time
draw(); draw();

View File

@ -1,7 +1,7 @@
{ {
"id": "bwclk", "id": "bwclk",
"name": "BW Clock", "name": "BW Clock",
"version": "0.29", "version": "0.30",
"description": "A very minimalistic clock.", "description": "A very minimalistic clock.",
"readme": "README.md", "readme": "README.md",
"icon": "app.png", "icon": "app.png",