initial commit of weather settings

This commit is contained in:
vaguesyntax
2025-10-30 18:10:37 +03:00
parent d835d8bc30
commit 487c0fc916
2 changed files with 54 additions and 0 deletions
@@ -177,4 +177,51 @@ ContentPage {
}
}
}
ContentSection {
icon: "weather_mix"
title: Translation.tr("Weather")
ConfigRow {
ConfigSwitch {
buttonIcon: "assistant_navigation"
text: Translation.tr("Enable GPS based location")
checked: Config.options.bar.weather.enableGPS
onCheckedChanged: {
Config.options.bar.weather.enableGPS = checked;
}
}
ConfigSwitch {
buttonIcon: "thermometer"
text: Translation.tr("Use USCS (°F)")
checked: Config.options.bar.weather.useUSCS
onCheckedChanged: {
Config.options.bar.weather.useUSCS = checked;
}
StyledToolTip {
text: Translation.tr("It may take a few seconds to update")
}
}
}
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("City name")
text: Config.options.bar.weather.city
wrapMode: TextEdit.Wrap
onTextChanged: {
Config.options.bar.weather.city = text;
}
}
ConfigSpinBox {
icon: "av_timer"
text: Translation.tr("Polling interval (m)")
value: Config.options.bar.weather.fetchInterval
from: 5
to: 50
stepSize: 5
onValueChanged: {
Config.options.bar.weather.fetchInterval = value;
}
}
}
}
@@ -16,6 +16,13 @@ Singleton {
readonly property bool useUSCS: Config.options.bar.weather.useUSCS
property bool gpsActive: Config.options.bar.weather.enableGPS
onUseUSCSChanged: {
root.getData();
}
onCityChanged: {
root.getData();
}
property var location: ({
valid: false,
lat: 0,