mirror of https://github.com/espruino/BangleApps
Merge pull request #1495 from peerdavid/master
[Neonx] Ensure that widgets are hidden in fullscreen modepull/1488/head^2
commit
3e058ba822
|
@ -1,3 +1,4 @@
|
|||
0.01: Initial release
|
||||
0.02: Optional fullscreen mode
|
||||
0.03: Optional show lock status via color
|
||||
0.03: Optional show lock status via color
|
||||
0.04: Ensure that widgets are always hidden in fullscreen mode
|
|
@ -2,7 +2,7 @@
|
|||
"id": "neonx",
|
||||
"name": "Neon X & IO X Clock",
|
||||
"shortName": "Neon X Clock",
|
||||
"version": "0.03",
|
||||
"version": "0.04",
|
||||
"description": "Pebble Neon X & Neon IO X for Bangle.js",
|
||||
"icon": "neonx.png",
|
||||
"type": "clock",
|
||||
|
|
|
@ -74,6 +74,12 @@ function drawLine(poly, thickness){
|
|||
function drawClock(num){
|
||||
let tx, ty;
|
||||
|
||||
if(settings.fullscreen){
|
||||
g.clearRect(0,0,screenWidth,screenHeight);
|
||||
} else {
|
||||
g.clearRect(0,24,240,240);
|
||||
}
|
||||
|
||||
for (let x = 0; x <= 1; x++) {
|
||||
for (let y = 0; y <= 1; y++) {
|
||||
const current = ((y + 1) * 2 + x - 1);
|
||||
|
@ -106,6 +112,14 @@ function drawClock(num){
|
|||
function draw(date){
|
||||
queueDraw();
|
||||
|
||||
// Depending on the settings, we clear all widgets or draw those.
|
||||
if(settings.fullscreen){
|
||||
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
|
||||
} else {
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
|
||||
// Now lets draw the time/date
|
||||
let d = new Date();
|
||||
let l1, l2;
|
||||
|
||||
|
@ -126,12 +140,6 @@ function draw(date){
|
|||
l2 = ('0' + d.getMinutes()).substr(-2);
|
||||
}
|
||||
|
||||
if(settings.fullscreen){
|
||||
g.clearRect(0,0,screenWidth,screenHeight);
|
||||
} else {
|
||||
g.clearRect(0,24,240,240);
|
||||
}
|
||||
|
||||
drawClock([l1, l2]);
|
||||
}
|
||||
|
||||
|
@ -175,12 +183,6 @@ Bangle.on('lock', function(isLocked) {
|
|||
*/
|
||||
g.clear(1);
|
||||
Bangle.setUI("clock");
|
||||
draw();
|
||||
|
||||
Bangle.loadWidgets();
|
||||
|
||||
if(settings.fullscreen){
|
||||
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
|
||||
} else {
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
draw();
|
Loading…
Reference in New Issue