Merge pull request #691 from jes/master

Make counter work even when widgets are hidden, and make blobclk draw the time a bit sooner when LCD is powered on
master
Gordon Williams 2021-03-17 14:49:53 +00:00 committed by GitHub
commit 5ae5a8db57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -86,9 +86,9 @@ function clearTimers() {
} }
function startTimers() { function startTimers() {
g.clear(); g.clear();
redraw();
Bangle.drawWidgets(); Bangle.drawWidgets();
intervalRef = setInterval(redraw,1000); intervalRef = setInterval(redraw,1000);
redraw();
} }
Bangle.loadWidgets(); Bangle.loadWidgets();
startTimers(); startTimers();

View File

@ -1,9 +1,8 @@
var counter = 0; var counter = 0;
g.setColor(0xFFFF);
function updateScreen() { function updateScreen() {
g.clearRect(0, 50, 250, 150); g.clearRect(0, 50, 250, 150);
g.setColor(0xFFFF);
g.setFont("Vector",40).setFontAlign(0,0); g.setFont("Vector",40).setFontAlign(0,0);
g.drawString(Math.floor(counter), g.getWidth()/2, 100); g.drawString(Math.floor(counter), g.getWidth()/2, 100);
g.drawString('-', 45, 100); g.drawString('-', 45, 100);
@ -44,7 +43,7 @@ g.drawString('Tap right or BTN1 to increase\nTap left or BTN3 to decrease\nPress
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
updateScreen();
// TODO: Enable saving counts to file // TODO: Enable saving counts to file
// Does not work if widgets are not visible
// Add small watch // Add small watch