Merge pull request #1 from thyttan/dsky_clock
commit
ddeceab7a4
|
|
@ -14,6 +14,8 @@ const LightFont='Teletext5x9Ascii';
|
||||||
const DataFont='7x11Numeric7Seg:2';
|
const DataFont='7x11Numeric7Seg:2';
|
||||||
var mode = 0;
|
var mode = 0;
|
||||||
|
|
||||||
|
if (global.WIDGETS) {require("widget_utils").swipeOn();} // If `dsky_clock` was fast loaded into we seemingly need to hide the widgets before setting the layout so elements are not moved down.
|
||||||
|
|
||||||
var layout = new Layout(
|
var layout = new Layout(
|
||||||
{type:"h", c:[
|
{type:"h", c:[
|
||||||
{type:"",width:6},
|
{type:"",width:6},
|
||||||
|
|
@ -54,7 +56,10 @@ var layout = new Layout(
|
||||||
]},
|
]},
|
||||||
{type:"",width:5},
|
{type:"",width:5},
|
||||||
],
|
],
|
||||||
lazy:true});
|
lazy:true},
|
||||||
|
{btns:[
|
||||||
|
{label:"", cb: Bangle.showLauncher}
|
||||||
|
], lazy:true});
|
||||||
layout.update();
|
layout.update();
|
||||||
|
|
||||||
//support functioe_ns
|
//support functioe_ns
|
||||||
|
|
@ -346,12 +351,6 @@ function queueDraw() {
|
||||||
}, 60000 - (Date.now() % 60000));
|
}, 60000 - (Date.now() % 60000));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show launcher when middle button pressed
|
|
||||||
Bangle.setUI("clock");
|
|
||||||
|
|
||||||
Bangle.loadWidgets();
|
|
||||||
require("widget_utils").swipeOn(); // hide widgets, make them visible with a swipe
|
|
||||||
|
|
||||||
Bangle.on('lock',on=>{
|
Bangle.on('lock',on=>{
|
||||||
mode = 0;
|
mode = 0;
|
||||||
drawMain(); // draw immediately
|
drawMain(); // draw immediately
|
||||||
|
|
@ -376,3 +375,7 @@ Bangle.on('swipe', function(directionLR) {
|
||||||
g.clear();
|
g.clear();
|
||||||
draw_bg();
|
draw_bg();
|
||||||
drawMain();
|
drawMain();
|
||||||
|
|
||||||
|
Bangle.CLOCK = 1;
|
||||||
|
Bangle.loadWidgets(); // loading widgets after drawing the layout in `drawMain()` to display the app UI ASAP.
|
||||||
|
require("widget_utils").swipeOn(); // hide widgets, make them visible with a swipe
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue