Merge pull request #439 from jeffmer/master

Update of widviz to use swipe rather than buttons.
pull/440/head
Gordon Williams 2020-05-22 13:24:54 +01:00 committed by GitHub
commit 793b5d6361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 10 deletions

View File

@ -1766,8 +1766,8 @@
"name": "Widget Visibility Widget",
"shortName":"Viz Widget",
"icon": "eye.png",
"version":"0.01",
"description": "Touch left screen to hide top bar widgets, right screen to redisplay. Will not work with apps that use BTN4 & BTN5.",
"version":"0.02",
"description": "Swipe left to hide top bar widgets, swipe right to redisplay.",
"tags": "widget",
"type": "widget",
"storage": [

View File

@ -1 +1,3 @@
0.01: New Widget
0.02: swipe left,right update

View File

@ -20,18 +20,15 @@
saved=null;
}
function setup(){
setWatch(hide, BTN4, {repeat:true,edge:"rising"});
setWatch(reveal, BTN5, {repeat:true,edge:"rising"});
}
function draw(){
var img = E.toArrayBuffer(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"));
g.setColor(0x07ff);
g.drawImage(img,this.x,this.y);
}
WIDGETS["viz"] ={area:"tl", width:24,draw:draw,setup:setup};
setup();
WIDGETS["viz"] ={area:"tl", width:24,draw:draw};
Bangle.on('swipe',(dir)=>{
if (dir<0) hide(); else reveal();
});
})();