From 9b49ee7eca95aed7ec72073acb69190bcab0f256 Mon Sep 17 00:00:00 2001 From: paul-arg <18153423+paul-arg@users.noreply.github.com> Date: Wed, 27 Aug 2025 09:56:56 +0200 Subject: [PATCH] widalarmeta: New font VGA8 for a more compact display Update widget.js --- apps/widalarmeta/ChangeLog | 1 + apps/widalarmeta/metadata.json | 4 ++-- apps/widalarmeta/screenshot2.png | Bin 0 -> 6329 bytes apps/widalarmeta/settings.js | 4 ++-- apps/widalarmeta/widget.js | 17 +++++++++++------ 5 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 apps/widalarmeta/screenshot2.png diff --git a/apps/widalarmeta/ChangeLog b/apps/widalarmeta/ChangeLog index 2cac2f8875..8ad1d86dc6 100644 --- a/apps/widalarmeta/ChangeLog +++ b/apps/widalarmeta/ChangeLog @@ -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 diff --git a/apps/widalarmeta/metadata.json b/apps/widalarmeta/metadata.json index f9e58acdf1..1aaf24ea60 100644 --- a/apps/widalarmeta/metadata.json +++ b/apps/widalarmeta/metadata.json @@ -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"} diff --git a/apps/widalarmeta/screenshot2.png b/apps/widalarmeta/screenshot2.png new file mode 100644 index 0000000000000000000000000000000000000000..e673400b475e6da91a9d74f4ccea22beaee3697a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Z*#B%F7JvH@|j{G3kiBQb+tBBu61Ji5}mGuyWI*@lpt z(#w(Qh3ksFq41z}zJ1pi&E`6|R$@(k^CB2lH8;Qnl9Yp$9%sQ@ZNbwegUVJF_w81F zDwEC6?0wh3vzK=6bF%^;RIvCb#S>1&A$mB?I6u==T<)Lu3uSTH(lib@jy-JdE>^aC zK{K{Ds~T{Vj(YD1H!p763HJ*)ZfPGF{k%W+W4&bTuctv7Vv-|qK7>{n<-XW_ye6@-Ak6 zd^6y3CSh6VX7IYf?H#u`>l@igCeKQ0S ztjwE5Eki>!h1g>$d_vOm$!S54&Nbt|MZX#2OI{G;Id9tfXp&K}-i*xQg6LS+8_jGZ zTUuXaAU#%RZMw(9#DLE+1kES0K4P1(M|&RLc$f29dvG^nE_xEfDnh^1&iwuM@B3Zo i_v_#Pf0yB)+0TdNcW&mzcWD2Gu>IG-t<{^OPX8B$=~`L< literal 0 HcmV?d00001 diff --git a/apps/widalarmeta/settings.js b/apps/widalarmeta/settings.js index 93b92a0d2c..72c7c19e06 100644 --- a/apps/widalarmeta/settings.js +++ b/apps/widalarmeta/settings.js @@ -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(); diff --git a/apps/widalarmeta/widget.js b/apps/widalarmeta/widget.js index 21097add85..94fded76f0 100644 --- a/apps/widalarmeta/widget.js +++ b/apps/widalarmeta/widget.js @@ -7,7 +7,7 @@ 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) || {}); @@ -15,7 +15,11 @@ 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(); @@ -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);