mirror of https://github.com/espruino/BangleApps
Merge pull request #1930 from deirdreobyrne/BigDClock-v0.03
Big Digit Clock - Internationalisation; small bug fixpull/1934/head
commit
10ad18674f
|
@ -1,2 +1,3 @@
|
||||||
0.01: Initial version
|
0.01: Initial version
|
||||||
0.02: setTimeout bug fix; no leading zero on date; lightmode; 12 hour format; cleanup
|
0.02: setTimeout bug fix; no leading zero on date; lightmode; 12 hour format; cleanup
|
||||||
|
0.03: Internationalisation; bug fix - battery icon responds promptly to charging state
|
||||||
|
|
|
@ -29,6 +29,7 @@ function draw() {
|
||||||
const level = E.getBattery();
|
const level = E.getBattery();
|
||||||
const width = level + (level/2);
|
const width = level + (level/2);
|
||||||
var is12Hour = (require("Storage").readJSON("setting.json", 1) || {})["12hour"];
|
var is12Hour = (require("Storage").readJSON("setting.json", 1) || {})["12hour"];
|
||||||
|
var dows = require("date_utils").dows(0,1);
|
||||||
|
|
||||||
g.reset();
|
g.reset();
|
||||||
g.clear();
|
g.clear();
|
||||||
|
@ -46,7 +47,7 @@ function draw() {
|
||||||
g.drawString(d, g.getWidth() -6, 98);
|
g.drawString(d, g.getWidth() -6, 98);
|
||||||
g.setFont('Vector', 52);
|
g.setFont('Vector', 52);
|
||||||
g.setFontAlign(-1, -1);
|
g.setFontAlign(-1, -1);
|
||||||
g.drawString("SUMOTUWETHFRSA".slice(2*w,2*w+2), 6, 103);
|
g.drawString(dows[w].slice(0,2).toUpperCase(), 6, 103);
|
||||||
|
|
||||||
g.fillRect(9,159,166,171);
|
g.fillRect(9,159,166,171);
|
||||||
g.fillRect(167,163,170,167);
|
g.fillRect(167,163,170,167);
|
||||||
|
@ -71,7 +72,6 @@ function draw() {
|
||||||
queueDraw();
|
queueDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//the following section is also from waveclk
|
|
||||||
Bangle.on('lcdPower', on => {
|
Bangle.on('lcdPower', on => {
|
||||||
if (on) {
|
if (on) {
|
||||||
draw(); // draw immediately, queue redraw
|
draw(); // draw immediately, queue redraw
|
||||||
|
@ -81,6 +81,10 @@ Bangle.on('lcdPower', on => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Bangle.on('charging', (charging) => {
|
||||||
|
draw();
|
||||||
|
});
|
||||||
|
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
draw();
|
draw();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "bigdclock",
|
{ "id": "bigdclock",
|
||||||
"name": "Big digit clock containing just the essentials",
|
"name": "Big digit clock containing just the essentials",
|
||||||
"shortName":"Big digit clk",
|
"shortName":"Big digit clk",
|
||||||
"version":"0.02",
|
"version":"0.03",
|
||||||
"description": "A clock containing just the essentials, made as easy to read as possible for those of us that need glasses. It contains the time, the day-of-week, the day-of-month, and the current battery state-of-charge.",
|
"description": "A clock containing just the essentials, made as easy to read as possible for those of us that need glasses. It contains the time, the day-of-week, the day-of-month, and the current battery state-of-charge.",
|
||||||
"icon": "bigdclock.png",
|
"icon": "bigdclock.png",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
|
|
Loading…
Reference in New Issue