mirror of https://github.com/espruino/BangleApps
widget_utils for widviz
parent
737a3738d4
commit
9790084ffa
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue