iconlaunch - Initial implementation of remove UI

pull/2156/head
Martin Boonk 2022-09-27 20:44:48 +02:00
parent 8b2fac1a71
commit 5fb32eb29a
1 changed files with 157 additions and 148 deletions

View File

@ -1,8 +1,14 @@
{
const s = require("Storage");
const settings = s.readJSON("launch.json", true) || { showClocks: true, fullscreen: false,direct:false,oneClickExit:false };
function returnToClock() {
Bangle.setUI();
setTimeout(eval,0,s.read(".bootcde"));
}
if( settings.oneClickExit)
setWatch(_=> load(), BTN1);
setWatch(returnToClock, BTN1);
if (!settings.fullscreen) {
Bangle.loadWidgets();
@ -155,9 +161,7 @@ g.flip();
const itemsN = Math.ceil(apps.length / appsN);
Bangle.setUI({
mode: "custom",
drag: (e) => {
function onDrag(e){
g.setColor(g.theme.fg);
g.setBgColor(g.theme.bg);
let dy = e.dy;
@ -202,10 +206,15 @@ Bangle.setUI({
}
}
g.setClipRect(0, 0, g.getWidth() - 1, g.getHeight() - 1);
},
}
Bangle.setUI({
mode: "custom",
drag: onDrag,
touch: (_, e) => {
if (e.y < R.y - 4) return;
var i = YtoIdx(e.y);
selectItem(i, e);
},
});
}