Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/widalarmeta/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
0.11: Bugfix: handle changes in alarms (e.g. done without a load, such as via fastload)
0.12: Redraw when screen turns on or watch is unlocked
0.13: Add option to only show when on clock
0.14: New font VGA8 for a more compact display
4 changes: 2 additions & 2 deletions apps/widalarmeta/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"id": "widalarmeta",
"name": "Alarm & Timer ETA",
"shortName": "Alarm ETA",
"version": "0.13",
"version": "0.14",
"description": "A widget that displays the time to the next Alarm or Timer in hours and minutes, maximum 24h (configurable).",
"icon": "widget.png",
"type": "widget",
"tags": "widget",
"supports": ["BANGLEJS","BANGLEJS2"],
"provides_widgets" : ["alarm"],
"screenshots" : [ { "url":"screenshot.png" } ],
"screenshots" : [ { "url":"screenshot.png" }, { "url":"screenshot2.png" } ],
"storage": [
{"name":"widalarmeta.wid.js","url":"widget.js"},
{"name":"widalarmeta.settings.js","url":"settings.js"}
Expand Down
Binary file added apps/widalarmeta/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/widalarmeta/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
},
/*LANG*/'Font': {
value: settings.font,
min: 0, max: 2,
format: v => [/*LANG*/"Segment", /*LANG*/"Teletext", /*LANG*/"6x8"][v === undefined ? 1 : v],
min: 0, max: 3,
format: v => [/*LANG*/"Segment", /*LANG*/"Teletext", /*LANG*/"6x8", /*LANG*/"VGA8",][v === undefined ? 1 : v],
onchange: v => {
settings.font = v;
writeSettings();
Expand Down
17 changes: 11 additions & 6 deletions apps/widalarmeta/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
drawBell: false,
padHours: true,
showSeconds: 0, // 0=never, 1=only when display is unlocked, 2=for less than a minute
font: 1, // 0=segment style font, 1=teletext font, 2=6x8:1x2
font: 1, // 0=segment style font, 1=teletext font, 2=6x8:1x2, 3=VGA8
whenToShow: 0, // 0=always, 1=on clock only
}, require("Storage").readJSON("widalarmeta.json",1) || {});

if (config.font == 0) {
require("Font5x9Numeric7Seg").add(Graphics);
} else if (config.font == 1) {
require("FontTeletext5x9Ascii").add(Graphics);
}
} else if (config.font == 2) {
require("Font6x8").add(Graphics);
} else if (config.font == 3) {
require("FontVGA8").add(Graphics);
}
}
loadSettings();

Expand Down Expand Up @@ -80,17 +84,18 @@
} else {
text += hours;
}
text += ":" + minutes.padStart(2, '0');
text += (config.font == 3 ? "\n" : ":") + minutes.padStart(2, '0');
if (drawSeconds) {
text += ":" + seconds.padStart(2, '0');
text += (config.font == 3 ? "\n" : ":") + seconds.padStart(2, '0');
}
if (config.font == 0) {
g.setFont("5x9Numeric7Seg:1x2");
} else if (config.font == 1) {
g.setFont("Teletext5x9Ascii:1x2");
} else {
// Default to this if no other font is set.
} else if (config.font == 2) {
g.setFont("6x8:1x2");
} else if (config.font == 3) {
g.setFont("VGA8");
}
g.drawString(text, this.x+1, this.y+12);

Expand Down