diff --git a/apps.json b/apps.json index 1f1937daf..8beaee6f1 100644 --- a/apps.json +++ b/apps.json @@ -668,7 +668,7 @@ "name": "Battery Level Widget (with percentage)", "shortName": "Battery Widget", "icon": "widget.png", - "version":"0.13", + "version":"0.14", "description": "Show the current battery level and charging status in the top right of the clock, with charge percentage", "tags": "widget,battery,b2", "type":"widget", @@ -3622,7 +3622,7 @@ "readme": "README.md", "tags": "tool, b2", "storage": [ - {"name":"stopwatch.app.js","url":"stopwatch.js"}, + {"name":"stopwatch.app.js","url":"stopwatch.app.js"}, {"name":"stopwatch.img","url":"stopwatch.icon.js","evaluate":true} ] } diff --git a/apps/widbatpc/ChangeLog b/apps/widbatpc/ChangeLog index 09e4fabf4..b8e594fc4 100644 --- a/apps/widbatpc/ChangeLog +++ b/apps/widbatpc/ChangeLog @@ -10,3 +10,4 @@ 0.11: Don't overwrite existing settings on app update 0.12: Fixed for Bangle 2 0.13: Fillbar setting added, see README +0.14: Added setting to completely hide the widget diff --git a/apps/widbatpc/settings.js b/apps/widbatpc/settings.js index b7a5db9e6..55588238d 100644 --- a/apps/widbatpc/settings.js +++ b/apps/widbatpc/settings.js @@ -13,6 +13,7 @@ 'fillbar': false, 'charger': true, 'hideifmorethan': 100, + 'hidewidget': false, } // ...and overwrite them with any saved values // This way saved values are preserved if a new version adds more settings @@ -31,7 +32,8 @@ } } - const onOffFormat = b => (b ? 'on' : 'off') + const onOffFormat = b => (b ? 'On' : 'Off') + const yesNoFormat = b => (b ? 'Yes' : 'No') const menu = { '': { 'title': 'Battery Widget' }, '< Back': back, @@ -68,6 +70,11 @@ format: x => x+"%", onchange: save('hideifmorethan'), }, + 'Hide Widget': { + value: s.hidewidget, + format: yesNoFormat, + onchange: save('hidewidget'), + }, } E.showMenu(menu) }) diff --git a/apps/widbatpc/widget.js b/apps/widbatpc/widget.js index caecf8ae4..574c22f6c 100644 --- a/apps/widbatpc/widget.js +++ b/apps/widbatpc/widget.js @@ -76,6 +76,7 @@ function draw() { // if hidden, don't draw if (!WIDGETS["batpc"].width) return; + if (setting('hidewidget')) return; // else... var s = 39; var x = this.x, y = this.y;