From 0ccea50efe38cc5eeba59363249b572836ed113f Mon Sep 17 00:00:00 2001 From: naden Date: Thu, 7 Mar 2024 21:20:39 +0100 Subject: [PATCH] Add files via upload replaced icons with "Graphics.createImage" --- apps/regattatimer/ChangeLog | 1 + apps/regattatimer/README.md | 5 +--- apps/regattatimer/app.js | 52 +++++++++++++++++++++------------ apps/regattatimer/metadata.json | 2 +- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/apps/regattatimer/ChangeLog b/apps/regattatimer/ChangeLog index 4d191aaac..d4a7600a2 100644 --- a/apps/regattatimer/ChangeLog +++ b/apps/regattatimer/ChangeLog @@ -2,3 +2,4 @@ 0.2: (2024-02-23) fixed minor issues with settings 0.3: (2024-03-01) advanced settings, rearanged ui elements, fixed rendering problems 0.31: (2024-03-06) fixed typos in readme, removed some unnecessary code +0.32: replaced icons with "Graphics.createImage" diff --git a/apps/regattatimer/README.md b/apps/regattatimer/README.md index 4397a894d..f93086fe5 100644 --- a/apps/regattatimer/README.md +++ b/apps/regattatimer/README.md @@ -65,10 +65,7 @@ Report bugs or request a feature at [github.com/naden](https://github.com/naden) ## Roadmap * add a second coundown layout; mimic a classic regatta chronograph * add recording of gps course and race time -* add icons for light mode -* add flag icons for start mode +* add flag icons for start mode screen ## Created by © 2021 - 2024 [naden.de](https://naden.de) - -Icons by [Icons8](https://icons8.com/) diff --git a/apps/regattatimer/app.js b/apps/regattatimer/app.js index abc19b2a7..79babb1bf 100644 --- a/apps/regattatimer/app.js +++ b/apps/regattatimer/app.js @@ -35,7 +35,6 @@ function Regattatimer() { } }, race: function() { - } }, */ @@ -48,28 +47,43 @@ function Regattatimer() { "Light": { "fgColor": "#000000", "bgColor": "#FFFF00", - "icons": { - "satellites": function() { - return hs.decompress(atob("jEYxH+AH4Ab6QIIBJAfNAAQtSC4gxSCwgYHHBYYMC6IYPC5AZOC8QYMC5YYLC5inSDH4waVbAYJCpgA/AAI=")); - }, - "battery": function() { - return hs.decompress(atob("jEYxH+AHHSAAgXmCgoaRC/4X/C/4X/C/4X/C64Ap")); - } - } }, "Dark": { "fgColor": "#FFFF00", "bgColor": "#000000", - "icons": { - "satellites": function() { - return hs.decompress(atob("jEYxH+AH4Ab6QIIBJAfNAAQtSC4gxSCwgYHHBYYMC6IYPC5AZOC8QYMC5YYLC5inSDH4waVbAYJCpgA/AAI=")); - }, - "battery": function() { - return hs.decompress(atob("jEYxH+AHHSAAgXmCgoaRC/4X/C/4X/C/4X/C64Ap")); - } - } } }, + icons: { + "battery": function() { + return Graphics.createImage(` + XXXX +X X +X XX X +X X +X XX X +X X +X XX X +X X +X XX X +X X +XXXXXX`); + }, + "satellites": function() { + return Graphics.createImage(` + X + XoX + XoX + XoX + XoX o X + XoX o o XoX +XoX o o XoX + X o XoX + XoX + XoX + XoX + X`); + }, + }, settings: Object.assign({ "debug": false, "buzzer": true, @@ -304,11 +318,11 @@ function Regattatimer() { {type: "txt", font: "10%", label: this.translate("speed_unit"), col: this.theme.fgColor, pad:4, fillx:1, filly:1}, ]}, {type: "h", c: [ - {type:"img", pad: 2, src: this.theme["icons"].satellites()}, + {type:"img", pad: 2, col: this.theme.fgColor, bgCol: this.theme.bgColor, src: this.icons.satellites()}, {type: "txt", font: "10%", label: "0", col: this.theme.fgColor, pad: 2, filly:1, id: "satellites"}, // hacky, use empty element with fillx to push the other elments to the left an right side {type: undefined, pad: 2, fillx: 1}, - {type:"img", pad: 2, src: this.theme["icons"].battery()}, + {type:"img", pad: 2, col: this.theme.fgColor, bgCol: this.theme.bgColor, src: this.icons.battery()}, {type: "txt", font: "10%", label: "-", col: this.theme.fgColor, pad: 2, filly: 1, id: "battery"}, ]} ]}, {lazy: true}); diff --git a/apps/regattatimer/metadata.json b/apps/regattatimer/metadata.json index a3579fcf8..bff2e7962 100644 --- a/apps/regattatimer/metadata.json +++ b/apps/regattatimer/metadata.json @@ -2,7 +2,7 @@ "id": "regattatimer", "name": "Regatta Timer", "shortName": "RegattaTimer", - "version": "0.31", + "version": "0.32", "description": "Regatta Timer with 5-4-1 Countdown", "icon": "icon.png", "tags": "tool,outdoors,sailing,race,regatta,boat,timer",