circlesclock: optional legacy weather icons
parent
92bf3579f2
commit
bd6f3c9304
|
|
@ -336,11 +336,17 @@ function drawWeather(w) {
|
||||||
let percent = 0;
|
let percent = 0;
|
||||||
let data = settings.weatherCircleData;
|
let data = settings.weatherCircleData;
|
||||||
let tempString = "?", icon = undefined;
|
let tempString = "?", icon = undefined;
|
||||||
|
let scale = 16/24; //our icons are 16x16 while clkinfo's are 24x24
|
||||||
|
|
||||||
if(weatherCond) {
|
if(weatherCond) {
|
||||||
weatherCond.show()
|
weatherCond.show()
|
||||||
weatherCond.hide()
|
weatherCond.hide()
|
||||||
icon = weatherCond.get().img;
|
let data = weatherCond.get()
|
||||||
|
if(settings.legacyWeatherIcons) { //may disappear in future
|
||||||
|
icon = getWeatherIconByCode(data.v);
|
||||||
|
scale = 1;
|
||||||
|
} else
|
||||||
|
icon = data.img;
|
||||||
}
|
}
|
||||||
if(weatherTemp) {
|
if(weatherTemp) {
|
||||||
weatherTemp.show()
|
weatherTemp.show()
|
||||||
|
|
@ -364,7 +370,7 @@ function drawWeather(w) {
|
||||||
|
|
||||||
if(icon) {
|
if(icon) {
|
||||||
g.setColor(getCircleIconColor("weather", color, percent))
|
g.setColor(getCircleIconColor("weather", color, percent))
|
||||||
.drawImage(icon, w - iconOffset, h3 + radiusOuter - iconOffset, {scale: 16/24});
|
.drawImage(icon, w - iconOffset, h3 + radiusOuter - iconOffset, {scale: scale});
|
||||||
} else {
|
} else {
|
||||||
g.drawString("?", w, h3 + radiusOuter);
|
g.drawString("?", w, h3 + radiusOuter);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,12 @@
|
||||||
},
|
},
|
||||||
onchange: x => save('updateInterval', x),
|
onchange: x => save('updateInterval', x),
|
||||||
},
|
},
|
||||||
|
//TODO deprecated local icons, may disappear in future
|
||||||
|
/*LANG*/'legacy weather icons': {
|
||||||
|
value: !!settings.legacyWeatherIcons,
|
||||||
|
format: () => (settings.legacyWeatherIcons ? 'Yes' : 'No'),
|
||||||
|
onchange: x => save('legacyWeatherIcons', x),
|
||||||
|
},
|
||||||
/*LANG*/'show big weather': {
|
/*LANG*/'show big weather': {
|
||||||
value: !!settings.showBigWeather,
|
value: !!settings.showBigWeather,
|
||||||
format: () => (settings.showBigWeather ? 'Yes' : 'No'),
|
format: () => (settings.showBigWeather ? 'Yes' : 'No'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue