From 737a3738d45386cf5ae46c5f1e301520a5e4ccc4 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Wed, 11 Jan 2023 20:15:13 +0100 Subject: [PATCH] widget_utils for thering --- apps/thering/ChangeLog | 2 ++ apps/thering/app.js | 5 ++--- apps/thering/metadata.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 apps/thering/ChangeLog diff --git a/apps/thering/ChangeLog b/apps/thering/ChangeLog new file mode 100644 index 000000000..25c572560 --- /dev/null +++ b/apps/thering/ChangeLog @@ -0,0 +1,2 @@ +0.01: Initial release. +0.02: Use widget_utils. diff --git a/apps/thering/app.js b/apps/thering/app.js index f7cfaa015..8767941b2 100644 --- a/apps/thering/app.js +++ b/apps/thering/app.js @@ -1,5 +1,6 @@ const h = g.getHeight(); const w = g.getWidth(); +const widget_utils = require('widget_utils'); // palette for 0-40% const pal1 = new Uint16Array([g.theme.bg, g.toColor("#020"), g.toColor("#0f0"), g.toColor("#00f")]); // palette for 50-100% @@ -215,10 +216,8 @@ Bangle.setUI("clock"); Bangle.loadWidgets(); /* * we are not drawing the widgets as we are taking over the whole screen - * so we will blank out the draw() functions of each widget and change the - * area to the top bar doesn't get cleared. */ -for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";} +widget_utils.hide(); draw(); setInterval(draw, 60000); diff --git a/apps/thering/metadata.json b/apps/thering/metadata.json index 32b1dae4b..6118a90f9 100644 --- a/apps/thering/metadata.json +++ b/apps/thering/metadata.json @@ -1,6 +1,6 @@ { "id": "thering", "name": "The Ring", - "version":"0.01", + "version":"0.02", "description": "A proof of concept clock with large ring guage for steps using pre-set images, acts as a tutorial piece for discussion", "icon": "app.png", "tags": "clock",