diff --git a/apps/bwclk/ChangeLog b/apps/bwclk/ChangeLog index 33cd7ef63..8b82f6843 100644 --- a/apps/bwclk/ChangeLog +++ b/apps/bwclk/ChangeLog @@ -28,4 +28,5 @@ 0.27: Clean out some leftovers in the remove function after switching to clkinfo.addInteractive that would cause ReferenceError. 0.28: Option to show (1) time only and (2) week of year. -0.29: use setItem of clockInfoMenu to change the active item \ No newline at end of file +0.29: use setItem of clockInfoMenu to change the active item +0.30: Use widget_utils. diff --git a/apps/bwclk/app.js b/apps/bwclk/app.js index c2518361b..29852e2b6 100644 --- a/apps/bwclk/app.js +++ b/apps/bwclk/app.js @@ -6,7 +6,7 @@ const locale = require('locale'); const storage = require('Storage'); const clock_info = require("clock_info"); - +const widget_utils = require("widget_utils"); /************************************************ * Globals @@ -277,9 +277,9 @@ let drawLock = function() { let drawWidgets = function() { if(isFullscreen()){ - for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";} + widget_utils.hide(); } 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 we have to show the widgets again, we load it from our // 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(); @@ -370,7 +370,8 @@ Bangle.loadWidgets(); // Cache draw function for dynamic screen to hide / show widgets // 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(); diff --git a/apps/bwclk/metadata.json b/apps/bwclk/metadata.json index a29102bdf..39106c827 100644 --- a/apps/bwclk/metadata.json +++ b/apps/bwclk/metadata.json @@ -1,7 +1,7 @@ { "id": "bwclk", "name": "BW Clock", - "version": "0.29", + "version": "0.30", "description": "A very minimalistic clock.", "readme": "README.md", "icon": "app.png",