From 9a5937a3eb3535636e74f926d83dd41ebdd8c407 Mon Sep 17 00:00:00 2001 From: Marco Heiming Date: Wed, 5 Jan 2022 19:38:18 +0100 Subject: [PATCH] Improve widget visibility --- apps/circlesclock/app.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/circlesclock/app.js b/apps/circlesclock/app.js index e10d55f17..a256c93ce 100644 --- a/apps/circlesclock/app.js +++ b/apps/circlesclock/app.js @@ -41,7 +41,7 @@ const colorRed = '#ff0000'; const colorGreen = '#008000'; const colorBlue = '#0000ff'; const colorYellow = '#ffff00'; -const widgetOffset = showWidgets ? 12 : 0; +const widgetOffset = showWidgets ? 14 : 0; const h = g.getHeight() - widgetOffset; const w = g.getWidth(); const hOffset = 30 - widgetOffset; @@ -55,9 +55,9 @@ const radiusOuter = 22; const radiusInner = 16; function draw() { - g.reset(); + g.clear(true); g.setColor(colorBg); - g.fillRect(0, 0, w, h); + g.fillRect(0, widgetOffset, w, h); // time g.setFont("Vector:50"); @@ -265,7 +265,7 @@ function shortValue(v) { } function getSteps() { - if (WIDGETS.wpedom !== undefined) { + if (WIDGETS && WIDGETS.wpedom !== undefined) { return WIDGETS.wpedom.getSteps(); } return 0; @@ -307,8 +307,6 @@ if (isCircleEnabled("battery")) { }); } -g.clear(); - Bangle.setUI("clock"); Bangle.loadWidgets(); if (!showWidgets) {