Lift setting() onto the Panel base too

Matches the BarWidget extraction in the previous commit. The weather
panel was the only panel reimplementing the helper inline; future
panels with inline settings get it for free.
This commit is contained in:
David Heinemeier Hansson
2026-05-20 20:27:59 +02:00
parent 16604c67b3
commit 73e6127d4e
2 changed files with 7 additions and 5 deletions
-5
View File
@@ -65,11 +65,6 @@ Panel {
readonly property string reportWind: current ? (useImperial ? (current.windspeedMiles + " mph") : (current.windspeedKmph + " km/h")) : ""
readonly property string reportHumidity: current ? (current.humidity + "%") : ""
function setting(name, fallback) {
var v = settings ? settings[name] : undefined
return v === undefined || v === null ? fallback : v
}
function refresh() {
if (!forecastProc.running) forecastProc.running = true
if (!locationProc.running) locationProc.running = true