From b77578333337250e21133a46bbd83388f2f11e52 Mon Sep 17 00:00:00 2001 From: David Peer Date: Mon, 21 Feb 2022 19:19:08 +0100 Subject: [PATCH] Bugfix: Ensure that widgets are always hidden in fulscreen mode. --- apps/neonx/ChangeLog | 3 ++- apps/neonx/metadata.json | 2 +- apps/neonx/neonx.app.js | 28 +++++++++++++++------------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/apps/neonx/ChangeLog b/apps/neonx/ChangeLog index 968d6d629..2e815a449 100644 --- a/apps/neonx/ChangeLog +++ b/apps/neonx/ChangeLog @@ -1,3 +1,4 @@ 0.01: Initial release 0.02: Optional fullscreen mode -0.03: Optional show lock status via color \ No newline at end of file +0.03: Optional show lock status via color +0.04: Ensure that widgets are always hidden in fullscreen mode \ No newline at end of file diff --git a/apps/neonx/metadata.json b/apps/neonx/metadata.json index 4ac7c4cea..840e5b82e 100644 --- a/apps/neonx/metadata.json +++ b/apps/neonx/metadata.json @@ -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", diff --git a/apps/neonx/neonx.app.js b/apps/neonx/neonx.app.js index 6a8b933e5..4b9231b0e 100644 --- a/apps/neonx/neonx.app.js +++ b/apps/neonx/neonx.app.js @@ -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(); -} \ No newline at end of file +draw(); \ No newline at end of file