forked from Shinonome/dots-hyprland
initial commit of weather settings
This commit is contained in:
@@ -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
|
readonly property bool useUSCS: Config.options.bar.weather.useUSCS
|
||||||
property bool gpsActive: Config.options.bar.weather.enableGPS
|
property bool gpsActive: Config.options.bar.weather.enableGPS
|
||||||
|
|
||||||
|
onUseUSCSChanged: {
|
||||||
|
root.getData();
|
||||||
|
}
|
||||||
|
onCityChanged: {
|
||||||
|
root.getData();
|
||||||
|
}
|
||||||
|
|
||||||
property var location: ({
|
property var location: ({
|
||||||
valid: false,
|
valid: false,
|
||||||
lat: 0,
|
lat: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user