Icon fixed, change expiry text to be ambiguous between platforms

master
RKBoss6 2025-07-24 17:41:09 -04:00 committed by GitHub
parent d4f7470037
commit 7bb0218899
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 13 deletions

View File

@ -10,8 +10,8 @@ var layout = new Layout({type:"v", bgCol: g.theme.bg, c: [
{filly: 1},
{type: "h", filly: 0, c: [
{type: "v", width: g.getWidth()/2, c: [ // Vertical container for icon + UV
{type: "custom", fillx: 1, height: g.getHeight()/2 - 30, valign: -1, txt: "unknown", id: "icon",
render: l => weather.drawIcon(l, l.x+l.w/2, l.y+l.h/2.1, l.w/2.1-10)},
{type: "custom", fillx: 1, height: (g.getHeight()/2)-10, valign: -1, txt: "unknown", id: "icon",bgCol:g.theme.bg,
render: l => weather.drawIcon(l, l.x+l.w/2, l.y+l.h/2, l.w/3)},
{type: "custom", fillx: 1, height: 20, id: "uvDisplay",
render: l => {
if (!current || current.uv === undefined) return;
@ -44,15 +44,14 @@ var layout = new Layout({type:"v", bgCol: g.theme.bg, c: [
]},
{type: "v", fillx: 1, c: [
{pad:5},
{type: "h", pad: 2, c: [
{type: "txt", font: "18%", id: "temp", label: "000"},
{type: "txt", font: "12%", valign: -1, id: "tempUnit", label: "°C"},
]},
{filly: 1},
{type: "h", pad: 1, c: [
{type: "txt", font: "6x8", pad: 2, halign: 1, id: "feelsLikeLabel",label: /*LANG*/"Feels:"},
{type: "txt", font: "9%", pad: 2, halign: 1, id: "feelsLike", label: "35°F"},
{type: "txt", font: "6x8", pad: 2, halign: 1, label: /*LANG*/"Feels:"},
{type: "txt", font: "9%", pad: 2, halign: 1, id: "feelslike", label: "35°F"},
]},
{filly: 1},
{type: "h", pad: 2, c: [
@ -95,11 +94,9 @@ function draw() {
layout.temp.label = temp[1];
layout.tempUnit.label = temp[2];
if (!current || current.feels === undefined){
layout.feelsLike.label = "";
layout.feelsLikeLabel.label="";
layout.feelslike.label = "N/A";
}else{
layout.feelsLike.label = feelsLikeTemp[1]+feelsLikeTemp[2];
layout.feelsLikeLabel.label="Feels: ";
layout.feelslike.label = feelsLikeTemp[1]+feelsLikeTemp[2];
}
layout.hum.label = current.hum+"%";
@ -109,7 +106,6 @@ function draw() {
layout.cond.label = current.txt.charAt(0).toUpperCase()+(current.txt||'').slice(1);
layout.loc.label = current.loc;
layout.updateTime.label = `${formatDuration(Date.now() - current.time)} ago`; // How to autotranslate this and similar?
//layout.clear(layout.feelsLike);
layout.update();
layout.render();
}
@ -118,7 +114,6 @@ function drawUpdateTime() {
if (!current || !current.time) return;
layout.updateTime.label = `${formatDuration(Date.now() - current.time)} ago`;
layout.update();
layout.render();
}
function update() {
@ -129,9 +124,9 @@ function update() {
} else {
layout.forgetLazyState();
if (NRF.getSecurityStatus().connected) {
E.showMessage(/*LANG*/"Weather data\nexpired.\n\nRe-push weather\ndata from your\nphone");
E.showMessage(/*LANG*/"Weather Data Expired");
} else {
E.showMessage(/*LANG*/"Weather data\n has expired.");
E.showMessage(/*LANG*/"Weather\nunknown\n\nPhone\nnot connected");
NRF.on("connect", update);
}
}