Clock apps tell clock widgets to hide #6

pull/2113/head
thyttan 2022-09-07 00:57:47 +02:00
parent 4097f19d4e
commit ab15ed66a2
18 changed files with 43 additions and 37 deletions

View File

@ -1 +1,2 @@
0.01: first release 0.01: first release
0.02: Tell clock widgets to hide.

View File

@ -2,7 +2,7 @@
"id": "pebbled", "id": "pebbled",
"name": "Pebble Clock with distance", "name": "Pebble Clock with distance",
"shortName": "Pebble + distance", "shortName": "Pebble + distance",
"version": "0.01", "version": "0.02",
"description": "Fork of Pebble Clock with distance in KM. Both step count and the distance are on the main screen. Default step length = 0.75m (can be changed in settings).", "description": "Fork of Pebble Clock with distance in KM. Both step count and the distance are on the main screen. Default step length = 0.75m (can be changed in settings).",
"readme": "README.md", "readme": "README.md",
"icon": "pebbled.png", "icon": "pebbled.png",

View File

@ -115,6 +115,7 @@ function getSteps() {
return '0'; return '0';
} }
Bangle.setUI("clock");
g.clear(); g.clear();
Bangle.loadWidgets(); Bangle.loadWidgets();
/* /*
@ -126,4 +127,3 @@ for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
loadSettings(); loadSettings();
setInterval(draw, 15000); // refresh every 15s setInterval(draw, 15000); // refresh every 15s
draw(); draw();
Bangle.setUI("clock");

View File

@ -5,3 +5,4 @@
0.05: Changes which circle show minutes and seconds 0.05: Changes which circle show minutes and seconds
0.06: Avoid function wrapper, use setUI for launcher 0.06: Avoid function wrapper, use setUI for launcher
Clock face smaller so no longer breaks widgets Clock face smaller so no longer breaks widgets
0.07: Tell clock widgets to hide.

View File

@ -2,7 +2,7 @@
"id": "rclock", "id": "rclock",
"name": "Round clock with seconds, minutes and date", "name": "Round clock with seconds, minutes and date",
"shortName": "Round Clock", "shortName": "Round Clock",
"version": "0.06", "version": "0.07",
"description": "Designed round clock with ticks for minutes and seconds and heart rate indication", "description": "Designed round clock with ticks for minutes and seconds and heart rate indication",
"icon": "app.png", "icon": "app.png",
"type": "clock", "type": "clock",

View File

@ -196,6 +196,9 @@ const drawHR = function () {
} }
}; };
// Show launcher when button pressed
Bangle.setUI("clock");
// clean app screen // clean app screen
g.clear(); g.clear();
Bangle.loadWidgets(); Bangle.loadWidgets();
@ -222,5 +225,3 @@ Bangle.on('HRM', function (d) {
// draw now // draw now
drawClock(); drawClock();
// Show launcher when button pressed
Bangle.setUI("clock");

View File

@ -6,4 +6,5 @@
0.06: Add 12h support and autocycle control 0.06: Add 12h support and autocycle control
0.07: added localization, removed deprecated code 0.07: added localization, removed deprecated code
0.08: removed unused font, fix autocycle, imported suncalc and trimmed, removed pedometer dependency, "tap to cycle" setting 0.08: removed unused font, fix autocycle, imported suncalc and trimmed, removed pedometer dependency, "tap to cycle" setting
0.09: fix battery icon size 0.09: fix battery icon size
0.10: Tell clock widgets to hide.

View File

@ -2,7 +2,7 @@
"id": "rebble", "id": "rebble",
"name": "Rebble Clock", "name": "Rebble Clock",
"shortName": "Rebble", "shortName": "Rebble",
"version": "0.09", "version": "0.10",
"description": "A Pebble style clock, with configurable background, three sidebars including steps, day, date, sunrise, sunset, long live the rebellion", "description": "A Pebble style clock, with configurable background, three sidebars including steps, day, date, sunrise, sunset, long live the rebellion",
"readme": "README.md", "readme": "README.md",
"icon": "rebble.png", "icon": "rebble.png",

View File

@ -292,18 +292,6 @@ function queueDraw() {
log_debug("starting.."); log_debug("starting..");
g.clear();
Bangle.loadWidgets();
/*
* we are not drawing the widgets as we are taking over the whole screen
* so we will blank out the draw() functions of each widget and change the
* area to the top bar doesn't get cleared.
*/
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
loadSettings();
loadLocation();
if(settings.autoCycle || settings.sideTap==0) if(settings.autoCycle || settings.sideTap==0)
{ {
@ -318,6 +306,19 @@ else{
} }
g.clear();
Bangle.loadWidgets();
/*
* we are not drawing the widgets as we are taking over the whole screen
* so we will blank out the draw() functions of each widget and change the
* area to the top bar doesn't get cleared.
*/
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
loadSettings();
loadLocation();
draw(); // queues the next draw for a minutes time draw(); // queues the next draw for a minutes time
@ -331,4 +332,4 @@ Bangle.on('charging', function(charging) {
drawSideBar2(); drawSideBar2();
break; break;
} }
}); });

View File

@ -2,3 +2,4 @@
0.02: Minor tweaks for light theme 0.02: Minor tweaks for light theme
0.03: Made images 2 bit and fixed theme honoring 0.03: Made images 2 bit and fixed theme honoring
0.04: Fixed date font alignment and changed date font to match a real Rolex 0.04: Fixed date font alignment and changed date font to match a real Rolex
0.05: Tell clock widget to hide.

View File

@ -44,7 +44,9 @@ let cx = W/2;
let cy = H/2; let cy = H/2;
let Timeout; let Timeout;
Bangle.loadWidgets(); Bangle.setUI("clock");
// load widgets after 'setUI' so they're aware there is a clock active
Bangle.loadWidgets();
/* Custom version of Bangle.drawWidgets (does not clear the widget areas) Thanks to rozek */ /* Custom version of Bangle.drawWidgets (does not clear the widget areas) Thanks to rozek */
@ -142,8 +144,4 @@ Bangle.on('lcdPower', (on) => {
displayRefresh(); displayRefresh();
} }
}); });
displayRefresh();
Bangle.setUI("clock");
// load widgets after 'setUI' so they're aware there is a clock active
Bangle.loadWidgets();
displayRefresh();

View File

@ -3,7 +3,7 @@
"shortName":"rolex", "shortName":"rolex",
"icon": "rolex.png", "icon": "rolex.png",
"screenshots": [{"url":"screenshot1.png"}], "screenshots": [{"url":"screenshot1.png"}],
"version":"0.04", "version":"0.05",
"description": "A rolex like watch face", "description": "A rolex like watch face",
"tags": "clock", "tags": "clock",
"type": "clock", "type": "clock",

View File

@ -1,2 +1,3 @@
0.01: Initial Release 0.01: Initial Release
0.02: Shrink hand images to save memory 0.02: Shrink hand images to save memory
0.03: Tell clock widgets to hide.

View File

@ -52,7 +52,9 @@ let cx = W/2;
let cy = H/2; let cy = H/2;
let Timeout; let Timeout;
Bangle.loadWidgets(); Bangle.setUI("clock");
// load widgets after 'setUI' so they're aware there is a clock active
Bangle.loadWidgets();
/* Custom version of Bangle.drawWidgets (does not clear the widget areas) Thanks to rozek */ /* Custom version of Bangle.drawWidgets (does not clear the widget areas) Thanks to rozek */
@ -175,7 +177,4 @@ Bangle.on('lcdPower', (on) => {
} }
}); });
Bangle.setUI("clock");
// load widgets after 'setUI' so they're aware there is a clock active
Bangle.loadWidgets();
displayRefresh(); displayRefresh();

View File

@ -3,7 +3,7 @@
"shortName":"5actus", "shortName":"5actus",
"icon": "seiko-5actus.png", "icon": "seiko-5actus.png",
"screenshots": [{"url":"screenshot.png"}], "screenshots": [{"url":"screenshot.png"}],
"version":"0.02", "version":"0.03",
"description": "A watch designed after then Seiko 5actus from the 1970's", "description": "A watch designed after then Seiko 5actus from the 1970's",
"tags": "clock", "tags": "clock",
"type": "clock", "type": "clock",

View File

@ -7,3 +7,4 @@
0.07: Support for Bangle.js 2 and themes 0.07: Support for Bangle.js 2 and themes
0.08: Removed "wake LCD on face-up"-feature: A watch-face should not set things like "wake LCD on face-up". 0.08: Removed "wake LCD on face-up"-feature: A watch-face should not set things like "wake LCD on face-up".
0.09: Added button control toggle and other live controls to new settings screen. 0.09: Added button control toggle and other live controls to new settings screen.
0.10: Tell clock widgets to hide.

View File

@ -1,7 +1,7 @@
{ {
"id": "slidingtext", "id": "slidingtext",
"name": "Sliding Clock", "name": "Sliding Clock",
"version": "0.09", "version": "0.10",
"description": "Inspired by the Pebble sliding clock, old times are scrolled off the screen and new times on. You are also able to change language on the fly so you can see the time written in other languages using button 1. Currently English, French, Japanese, Spanish and German are supported", "description": "Inspired by the Pebble sliding clock, old times are scrolled off the screen and new times on. You are also able to change language on the fly so you can see the time written in other languages using button 1. Currently English, French, Japanese, Spanish and German are supported",
"icon": "slidingtext.png", "icon": "slidingtext.png",
"type": "clock", "type": "clock",

View File

@ -647,12 +647,13 @@ Bangle.on('lcdPower', (on) => {
g.clear(); g.clear();
load_settings(); load_settings();
Bangle.loadWidgets();
Bangle.drawWidgets();
startTimers();
// Show launcher when button pressed // Show launcher when button pressed
Bangle.setUI("clockupdown", d=>{ Bangle.setUI("clockupdown", d=>{
if (d<0) button1pressed(); if (d<0) button1pressed();
if (d>0) button3pressed(); if (d>0) button3pressed();
}); });
Bangle.loadWidgets();
Bangle.drawWidgets();
startTimers();