From a84588aca1c07ce2763585485bf2e62906be957a Mon Sep 17 00:00:00 2001 From: Ben Whittaker Date: Tue, 5 Oct 2021 21:04:21 -0400 Subject: [PATCH] weather: tweaks + changelog --- apps.json | 2 +- apps/weather/ChangeLog | 3 ++- apps/weather/app.js | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps.json b/apps.json index a7577945e..f3b8badd5 100644 --- a/apps.json +++ b/apps.json @@ -585,7 +585,7 @@ { "id": "weather", "name": "Weather", "icon": "icon.png", - "version":"0.09", + "version":"0.10", "description": "Show Gadgetbridge weather report", "readme": "readme.md", "tags": "widget,outdoors", diff --git a/apps/weather/ChangeLog b/apps/weather/ChangeLog index 09e159045..8f997a83e 100644 --- a/apps/weather/ChangeLog +++ b/apps/weather/ChangeLog @@ -5,4 +5,5 @@ 0.06: Use setUI for launcher. 0.07: Add theme support and unknown icon. 0.08: Refactor and reduce widget ram usage. -0.09: Fix crash when weather.json is absent. \ No newline at end of file +0.09: Fix crash when weather.json is absent. +0.10: Use new Layout library \ No newline at end of file diff --git a/apps/weather/app.js b/apps/weather/app.js index aab71f703..6dba14143 100644 --- a/apps/weather/app.js +++ b/apps/weather/app.js @@ -10,7 +10,7 @@ var layout = new Layout({type:"v", bgCol: g.theme.bg, c: [ {type: "h", filly: 0, c: [ {type: "custom", width: g.getWidth()/2, height: g.getWidth()/2, valign: -1, txt: "unknown", id: "icon", render: l => weather.drawIcon(l.txt, l.x+l.w/2, l.y+l.h/2, l.w/2-5)}, - {type: "v", c: [ + {type: "v", fillx: 1, c: [ {type: "h", pad: 2, c: [ {type: "txt", font: "18%", id: "temp", label: "000"}, {type: "txt", font: "12%", valign: -1, id: "tempUnit", label: "°C"}, @@ -30,9 +30,9 @@ var layout = new Layout({type:"v", bgCol: g.theme.bg, c: [ {type: "txt", font: "9%", wrap: true, height: g.getHeight()*0.18, fillx: 1, id: "cond", label: "Weather condition"}, {filly: 1}, {type: "h", c: [ - {type: "txt", font: "6x8", pad: 2, id: "loc", label: "Toronto"}, + {type: "txt", font: "6x8", pad: 4, id: "loc", label: "Toronto"}, {fillx: 1}, - {type: "txt", font: "6x8", pad: 2, id: "updateTime", label: "15 minutes ago"}, + {type: "txt", font: "6x8", pad: 4, id: "updateTime", label: "15 minutes ago"}, ]}, {filly: 1}, ]}, null, {lazy: true}); @@ -76,9 +76,9 @@ function update() { } else { layout.forgetLazyState(); if (NRF.getSecurityStatus().connected) { - E.showMessage("Weather unknown\n\nIs Gadgetbridge\nweather reporting\nset up on your\nphone?"); + E.showMessage("Weather\nunknown\n\nIs Gadgetbridge\nweather\nreporting set\nup on your\nphone?"); } else { - E.showMessage("Weather unknown\n\nGadgetbridge\nnot connected"); + E.showMessage("Weather\nunknown\n\nGadgetbridge\nnot connected"); NRF.on("connect", update); } }