commit
abc6b6776f
|
|
@ -10,3 +10,4 @@
|
|||
0.28: More config options for cleaner look, enabled fast loading
|
||||
0.29: Fixed a bug that would leave old font files in storage.
|
||||
0.30: Added options to show widgets and date on twist and tap. New fonts.
|
||||
0.31: Bugfix, no more freeze.
|
||||
|
|
|
|||
|
|
@ -34,9 +34,12 @@
|
|||
extrasTimeout = undefined;
|
||||
hideExtras();
|
||||
}, 5000);
|
||||
extrasShown = false;
|
||||
};
|
||||
let drawExtras = function() { //draw date, day of the week and widgets
|
||||
let date = new Date();
|
||||
g.reset();
|
||||
g.clearRect(0, 138, g.getWidth() - 1, 176);
|
||||
g.setFont("Teletext10x18Ascii").setFontAlign(0, 1);
|
||||
if (settings.weekday) g.drawString(require("locale").dow(date).toUpperCase(), g.getWidth() / 2, g.getHeight() - 18);
|
||||
if (settings.date) g.drawString(require('locale').date(date, 1), g.getWidth() / 2, g.getHeight());
|
||||
|
|
@ -45,21 +48,23 @@
|
|||
};
|
||||
let hideExtras = function() {
|
||||
if (extrasTimeout) clearTimeout(extrasTimeout);
|
||||
extrasTimeout = undefined; //NEW
|
||||
g.reset();
|
||||
g.clearRect(0, 138, g.getWidth() - 1, 176);
|
||||
require("widget_utils").hide();
|
||||
extrasShown = false;
|
||||
extrasShown = false; ///NEW
|
||||
};
|
||||
let draw = function() {
|
||||
if (drawTimeout) clearTimeout(drawTimeout); //NEW
|
||||
drawTimeout = setTimeout(function() {
|
||||
drawTimeout = undefined;
|
||||
draw();
|
||||
}, 60000 - (Date.now() % 60000));
|
||||
let date = new Date();
|
||||
g.reset();
|
||||
if (extrasShown) drawExtras();
|
||||
else hideExtras();
|
||||
require('contourclock').drawClock(settings.fontIndex);
|
||||
if (drawTimeout) clearTimeout(drawTimeout);
|
||||
drawTimeout = setTimeout(function() {
|
||||
drawTimeout = undefined;
|
||||
draw();
|
||||
}, 60000 - (Date.now() % 60000));
|
||||
};
|
||||
if (settings.hideWhenLocked) {
|
||||
onLock = locked => {
|
||||
|
|
@ -83,6 +88,8 @@
|
|||
Bangle.removeListener('twist', showExtras);
|
||||
if (drawTimeout) clearTimeout(drawTimeout);
|
||||
if (extrasTimeout) clearTimeout(extrasTimeout);
|
||||
drawTimeout = undefined;
|
||||
extrasTimeout = undefined;
|
||||
if (settings.hideWhenLocked) require("widget_utils").show();
|
||||
g.reset();
|
||||
g.clear();
|
||||
|
|
@ -91,7 +98,7 @@
|
|||
g.clear();
|
||||
if (settings.widgets) {
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
setTimeout(Bangle.drawWidgets,0); //NEW
|
||||
}
|
||||
draw();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ "id": "contourclock",
|
||||
"name": "Contour Clock",
|
||||
"shortName" : "Contour Clock",
|
||||
"version":"0.30",
|
||||
"version":"0.31",
|
||||
"icon": "app.png",
|
||||
"readme": "README.md",
|
||||
"description": "A Minimalist clockface with large Digits.",
|
||||
|
|
|
|||
Loading…
Reference in New Issue