feat(location): auto location/weather via IP

This commit is contained in:
Lemmy
2026-03-31 20:59:36 -04:00
parent 97553d7064
commit 80cd76b82e
26 changed files with 166 additions and 12 deletions
@@ -74,16 +74,37 @@ ColumnLayout {
}
NText {
visible: LocationService.coordinatesReady
text: I18n.tr("system.location-display", {
"name": LocationService.stableName,
"coordinates": LocationService.displayCoordinates
})
text: LocationService.coordinatesReady ? I18n.tr("system.location-display", {
"name": LocationService.stableName,
"coordinates": LocationService.displayCoordinates
}) : ""
pointSize: Style.fontSizeS
color: Color.mOnSurfaceVariant
}
}
// Auto-locate
RowLayout {
Layout.fillWidth: true
spacing: Style.marginM
NToggle {
Layout.fillWidth: true
label: I18n.tr("panels.location.auto-locate-label")
description: I18n.tr("panels.location.auto-locate-description")
checked: Settings.data.location.autoLocate
onToggled: checked => Settings.data.location.autoLocate = checked
defaultValue: Settings.getDefaultValue("location.autoLocate")
}
NButton {
text: I18n.tr("panels.location.geolocate-now-button")
icon: "current-location"
enabled: !LocationService.isFetchingWeather
onClicked: LocationService.geolocateAndApply()
}
}
ColumnLayout {
spacing: Style.marginL
Layout.fillWidth: true