1
0
Fork 0

widget_utils for widviz

master
thyttan 2023-01-11 20:23:08 +01:00
parent 737a3738d4
commit 9790084ffa
3 changed files with 5 additions and 11 deletions

View File

@ -1,3 +1,4 @@
0.01: New Widget
0.02: swipe left,right update
0.03: Fix widget visibility code to the top bar isn't cleared by drawWidgets
0.04: Use widget_utils.

View File

@ -2,7 +2,7 @@
"id": "widviz",
"name": "Widget Visibility Widget",
"shortName": "Viz Widget",
"version": "0.03",
"version": "0.04",
"description": "Swipe left to hide top bar widgets, swipe right to redisplay.",
"icon": "eye.png",
"type": "widget",

View File

@ -1,26 +1,19 @@
(() => {
let widget_utils = require('widget_utils');
var saved = null;
function hide(){
if (!Bangle.isLCDOn() || saved) return;
saved = [];
for (var wd of WIDGETS) {
saved.push({d:wd.draw,a:wd.area});
wd.draw=()=>{};
wd.area="";
}
widget_utils.hide();
g.setColor(0,0,0);
g.fillRect(0,0,g.getWidth(),23);
}
function reveal(){
if (!Bangle.isLCDOn() || !saved) return;
for (var wd of WIDGETS) {
var o = saved.shift();
wd.draw = o.d;
wd.area = o.a;
}
widget_utils.show();
Bangle.drawWidgets();
saved=null;
}