feat(location): add toggle to always show Talia weather emojis

This commit is contained in:
Lysec
2026-04-02 13:47:47 +02:00
parent 240312ea4b
commit f301a57137
9 changed files with 34 additions and 10 deletions
+2
View File
@@ -1403,6 +1403,8 @@
"weather-hide-timezone-label": "Hide timezone",
"weather-show-effects-description": "Show additional visual effects (like rain, snow, or lightning) on the weather card.",
"weather-show-effects-label": "Display weather effects",
"weather-talia-mascot-always-description": "Always use Talia emojis instead of tabler icons.",
"weather-talia-mascot-always-label": "Always show Talia weather emojis",
"weather-show-in-calendar-description": "Show the daily weather forecast directly in your calendar view.",
"weather-show-in-calendar-label": "Display weather in calendar"
},
+1
View File
@@ -162,6 +162,7 @@
"name": "",
"weatherEnabled": true,
"weatherShowEffects": true,
"weatherTaliaMascotAlways": false,
"useFahrenheit": false,
"use12hourFormat": false,
"showWeekNumberInCalendar": false,
+9
View File
@@ -2231,6 +2231,15 @@
"subTab": 0,
"subTabLabel": "common.location"
},
{
"labelKey": "panels.location.weather-talia-mascot-always-label",
"descriptionKey": "panels.location.weather-talia-mascot-always-description",
"widget": "NToggle",
"tab": 17,
"tabLabel": "panels.region.title",
"subTab": 0,
"subTabLabel": "common.location"
},
{
"labelKey": "panels.location.weather-hide-city-label",
"descriptionKey": "panels.location.weather-hide-city-description",
+1
View File
@@ -342,6 +342,7 @@ Singleton {
property string name: ""
property bool weatherEnabled: true
property bool weatherShowEffects: true
property bool weatherTaliaMascotAlways: false
property bool useFahrenheit: false
property bool use12hourFormat: false
property bool showWeekNumberInCalendar: false
+4 -4
View File
@@ -115,14 +115,14 @@ NBox {
readonly property int mainWeatherIconSide: Math.round(Style.fontSizeXXXL * 1.75 * Style.uiScaleRatio * 1.6)
NIcon {
visible: !LocationService.taliaWeatherMascotDayActive || !weatherReady
visible: !LocationService.taliaWeatherMascotActive || !weatherReady
anchors.centerIn: parent
icon: weatherReady ? LocationService.weatherSymbolFromCode(LocationService.data.weather.current_weather.weathercode, LocationService.data.weather.current_weather.is_day) : "weather-cloud-off"
pointSize: Style.fontSizeXXXL * 1.75
color: Color.mPrimary
}
Loader {
active: LocationService.taliaWeatherMascotDayActive && weatherReady
active: LocationService.taliaWeatherMascotActive && weatherReady
anchors.fill: parent
asynchronous: true
sourceComponent: Component {
@@ -216,14 +216,14 @@ NBox {
readonly property int forecastWeatherIconSide: Math.round(Style.fontSizeXXL * 1.6 * Style.uiScaleRatio * 1.6)
NIcon {
visible: !LocationService.taliaWeatherMascotDayActive
visible: !LocationService.taliaWeatherMascotActive
anchors.centerIn: parent
icon: LocationService.weatherSymbolFromCode(LocationService.data.weather.daily.weathercode[index])
pointSize: Style.fontSizeXXL * 1.6
color: Color.mPrimary
}
Loader {
active: LocationService.taliaWeatherMascotDayActive
active: LocationService.taliaWeatherMascotActive
anchors.fill: parent
asynchronous: true
sourceComponent: Component {
@@ -62,14 +62,14 @@ DraggableDesktopWidget {
Layout.alignment: Qt.AlignVCenter
NIcon {
visible: !LocationService.taliaWeatherMascotDayActive || !weatherReady
visible: !LocationService.taliaWeatherMascotActive || !weatherReady
anchors.centerIn: parent
icon: weatherReady ? LocationService.weatherSymbolFromCode(currentWeatherCode, LocationService.data.weather.current_weather.is_day) : "weather-cloud-off"
pointSize: Math.round(Style.fontSizeXXXL * 2 * widgetScale)
color: weatherReady ? Color.mPrimary : Color.mOnSurfaceVariant
}
Loader {
active: LocationService.taliaWeatherMascotDayActive && weatherReady
active: LocationService.taliaWeatherMascotActive && weatherReady
anchors.fill: parent
asynchronous: true
sourceComponent: Component {
+4 -4
View File
@@ -495,14 +495,14 @@ Item {
readonly property int lockMainWeatherIconSide: Math.round(Style.fontSizeXXXL * Style.uiScaleRatio * 1.6)
NIcon {
visible: !LocationService.taliaWeatherMascotDayActive || !weatherReady
visible: !LocationService.taliaWeatherMascotActive || !weatherReady
anchors.centerIn: parent
icon: weatherReady ? LocationService.weatherSymbolFromCode(LocationService.data.weather.current_weather.weathercode, LocationService.data.weather.current_weather.is_day) : "weather-cloud-off"
pointSize: Style.fontSizeXXXL
color: Color.mPrimary
}
Loader {
active: LocationService.taliaWeatherMascotDayActive && weatherReady
active: LocationService.taliaWeatherMascotActive && weatherReady
anchors.fill: parent
asynchronous: true
sourceComponent: Component {
@@ -609,14 +609,14 @@ Item {
readonly property int lockForecastWeatherIconSide: Math.round(Style.fontSizeXL * Style.uiScaleRatio * 1.6)
NIcon {
visible: !LocationService.taliaWeatherMascotDayActive
visible: !LocationService.taliaWeatherMascotActive
anchors.centerIn: parent
icon: LocationService.weatherSymbolFromCode(LocationService.data.weather.daily.weathercode[index])
pointSize: Style.fontSizeXL
color: Color.mOnSurfaceVariant
}
Loader {
active: LocationService.taliaWeatherMascotDayActive
active: LocationService.taliaWeatherMascotActive
anchors.fill: parent
asynchronous: true
sourceComponent: Component {
@@ -129,6 +129,15 @@ ColumnLayout {
enabled: Settings.data.location.weatherEnabled
}
NToggle {
label: I18n.tr("panels.location.weather-talia-mascot-always-label")
description: I18n.tr("panels.location.weather-talia-mascot-always-description")
checked: Settings.data.location.weatherTaliaMascotAlways
onToggled: checked => Settings.data.location.weatherTaliaMascotAlways = checked
enabled: Settings.data.location.weatherEnabled
defaultValue: Settings.getDefaultValue("location.weatherTaliaMascotAlways")
}
NToggle {
label: I18n.tr("panels.location.weather-hide-city-label")
description: I18n.tr("panels.location.weather-hide-city-description")
+2
View File
@@ -22,6 +22,8 @@ Singleton {
return d.getMonth() === root.taliaMascotWeatherMonth && d.getDate() === root.taliaMascotWeatherDay;
}
readonly property bool taliaWeatherMascotActive: taliaWeatherMascotDayActive || Settings.data.location.weatherTaliaMascotAlways
readonly property alias data: adapter
// Stable UI properties - only updated when location is successfully geocoded