From fd4a8fc44a52461fe2eba79abd03969500faac53 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Mon, 5 Jan 2026 15:42:44 +0100 Subject: [PATCH] RegionTab: add city & timezone display toggle --- Assets/Translations/de.json | 14 +++++++++++--- Assets/Translations/en.json | 14 +++++++++++--- Assets/Translations/es.json | 14 +++++++++++--- Assets/Translations/fr.json | 14 +++++++++++--- Assets/Translations/hu.json | 14 +++++++++++--- Assets/Translations/ja.json | 14 +++++++++++--- Assets/Translations/ku.json | 14 +++++++++++--- Assets/Translations/nl.json | 14 +++++++++++--- Assets/Translations/pl.json | 14 +++++++++++--- Assets/Translations/pt.json | 14 +++++++++++--- Assets/Translations/ru.json | 14 +++++++++++--- Assets/Translations/tr.json | 14 +++++++++++--- Assets/Translations/uk-UA.json | 14 +++++++++++--- Assets/Translations/zh-CN.json | 14 +++++++++++--- Commons/Settings.qml | 2 ++ Modules/Cards/CalendarHeaderCard.qml | 4 +++- Modules/Cards/WeatherCard.qml | 4 ++-- .../DesktopWidgets/Widgets/DesktopWeather.qml | 1 + Modules/LockScreen/LockScreen.qml | 1 + Modules/Panels/Settings/Tabs/RegionTab.qml | 16 ++++++++++++++++ 20 files changed, 179 insertions(+), 45 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index a31a6880c..3da01768d 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1980,6 +1980,14 @@ "description": "Temperatur in Fahrenheit statt Celsius anzeigen.", "label": "Temperatur in Fahrenheit (°F) anzeigen" }, + "hide-city": { + "description": "Verberge den Stadtnamen in Wetteranzeigen in der gesamten Benutzeroberfläche.", + "label": "Stadtname ausblenden" + }, + "hide-timezone": { + "description": "Die Zeitzonenabkürzung in Wetteranzeigen in der gesamten Benutzeroberfläche ausblenden.", + "label": "Zeitzone ausblenden" + }, "section": { "description": "Bevorzugte Temperatureinheit wählen.", "label": "Wetter" @@ -2013,9 +2021,6 @@ }, "title": "Sperrbildschirm" }, - "region": { - "title": "Region" - }, "network": { "bluetooth": { "description": "Bluetooth-Verwaltung aktivieren.", @@ -2340,6 +2345,9 @@ "update-version": "v{aktuell} → v{neu}", "updating": "Aktualisierung läuft..." }, + "region": { + "title": "Region" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 62a8cde2d..9b4bd6f3f 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1980,6 +1980,14 @@ "description": "Display temperature in Fahrenheit instead of Celsius.", "label": "Display temperature in Fahrenheit (°F)" }, + "hide-city": { + "description": "Hide the city name from weather displays throughout the interface.", + "label": "Hide city name" + }, + "hide-timezone": { + "description": "Hide the timezone abbreviation from weather displays throughout the interface.", + "label": "Hide timezone" + }, "section": { "description": "Choose your preferred temperature unit.", "label": "Weather" @@ -2013,9 +2021,6 @@ }, "title": "Lock Screen" }, - "region": { - "title": "Region" - }, "network": { "bluetooth": { "description": "Activate Bluetooth management.", @@ -2340,6 +2345,9 @@ "update-version": "v{current} → v{new}", "updating": "Updating..." }, + "region": { + "title": "Region" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index ed95f9e4e..dc30b3e68 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1980,6 +1980,14 @@ "description": "Muestra la temperatura en Fahrenheit en lugar de Celsius.", "label": "Mostrar temperatura en Fahrenheit (°F)" }, + "hide-city": { + "description": "Ocultar el nombre de la ciudad en las pantallas del tiempo en toda la interfaz.", + "label": "Ocultar nombre de la ciudad" + }, + "hide-timezone": { + "description": "Ocultar la abreviatura de la zona horaria en las pantallas del tiempo en toda la interfaz.", + "label": "Ocultar zona horaria" + }, "section": { "description": "Elige tu unidad de temperatura preferida.", "label": "Clima" @@ -2013,9 +2021,6 @@ }, "title": "Pantalla de bloqueo" }, - "region": { - "title": "Región" - }, "network": { "bluetooth": { "description": "Activar la gestión de Bluetooth.", @@ -2340,6 +2345,9 @@ "update-version": "v{actual} → v{nuevo}", "updating": "Actualizando..." }, + "region": { + "title": "Región" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 16591bf81..ff395315c 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1980,6 +1980,14 @@ "description": "Afficher la température en Fahrenheit au lieu de Celsius.", "label": "Afficher la température en Fahrenheit (°F)" }, + "hide-city": { + "description": "Masquer le nom de la ville dans les affichages météo de toute l'interface.", + "label": "Cacher le nom de la ville" + }, + "hide-timezone": { + "description": "Masquer l'abréviation du fuseau horaire des affichages météorologiques dans toute l'interface.", + "label": "Masquer le fuseau horaire" + }, "section": { "description": "Choisissez votre unité de température préférée.", "label": "Météo" @@ -2013,9 +2021,6 @@ }, "title": "Écran de verrouillage" }, - "region": { - "title": "Région" - }, "network": { "bluetooth": { "description": "Activer la gestion Bluetooth.", @@ -2340,6 +2345,9 @@ "update-version": "v{actuel} → v{nouveau}", "updating": "Mise à jour..." }, + "region": { + "title": "Région" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/hu.json b/Assets/Translations/hu.json index 83271f9a5..bef2c2ecb 100644 --- a/Assets/Translations/hu.json +++ b/Assets/Translations/hu.json @@ -1980,6 +1980,14 @@ "description": "Hőmérséklet megjelenítése Fahrenheitben Celsius helyett.", "label": "Hőmérséklet megjelenítése Fahrenheitben (°F)" }, + "hide-city": { + "description": "Rejtse el a városnevet az időjárás kijelzőkről a teljes felületen.", + "label": "Városnév elrejtése" + }, + "hide-timezone": { + "description": "Rejtse el az időzóna rövidítését a felületen megjelenő összes időjárás-előrejelzésből.", + "label": "Időzóna elrejtése" + }, "section": { "description": "A kívánt hőmérsékleti egység kiválasztása.", "label": "Időjárás" @@ -2013,9 +2021,6 @@ }, "title": "Zárolási képernyő" }, - "region": { - "title": "Régió" - }, "network": { "bluetooth": { "description": "A Bluetooth kezelés aktiválása.", @@ -2340,6 +2345,9 @@ "update-version": "v{current} → v{new}", "updating": "Frissítés..." }, + "region": { + "title": "Régió" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/ja.json b/Assets/Translations/ja.json index da3d21f5a..9c9ba1e01 100644 --- a/Assets/Translations/ja.json +++ b/Assets/Translations/ja.json @@ -1980,6 +1980,14 @@ "description": "気温を摂氏 (°C) ではなく華氏 (°F) で表示します。", "label": "華氏 (°F) で表示" }, + "hide-city": { + "description": "インターフェース全体の天気表示から都市名を隠してください。", + "label": "都市名を隠す" + }, + "hide-timezone": { + "description": "インターフェース全体の天気表示からタイムゾーンの略称を非表示にする。", + "label": "タイムゾーンを隠す" + }, "section": { "description": "温度の単位などを選択します。", "label": "天気" @@ -2013,9 +2021,6 @@ }, "title": "ロック画面" }, - "region": { - "title": "地域" - }, "network": { "bluetooth": { "description": "Bluetooth の管理を有効にします。", @@ -2340,6 +2345,9 @@ "update-version": "v{current} → v{new}", "updating": "更新中..." }, + "region": { + "title": "地域" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/ku.json b/Assets/Translations/ku.json index 87c946d34..499cfddb6 100644 --- a/Assets/Translations/ku.json +++ b/Assets/Translations/ku.json @@ -1980,6 +1980,14 @@ "description": "Germahiya bi Fahrenheit nîşan bide, ne bi Celsius.", "label": "Pîvana germahiyê bi Fahrenheit (°F) nîşan bide" }, + "hide-city": { + "description": "Navê bajarê ji dîmenên hewayê yên li seranserê navbeynê veşêre.", + "label": "Veşêre nameyê sûke" + }, + "hide-timezone": { + "description": "Demjim kurtkirina herêma demjimêrê ji pêşandanên hewayê li seranserê navbeynê.", + "label": "Demjimêrê veşêre" + }, "section": { "description": "Yekîneya germahiya xweya bijarte hilbijêrin.", "label": "Rewşa bayê" @@ -2013,9 +2021,6 @@ }, "title": "Dîmendera kilîtkirinê" }, - "region": { - "title": "Herêm" - }, "network": { "bluetooth": { "description": "Rêveberiya Bluetooth çalak bike.", @@ -2340,6 +2345,9 @@ "update-version": "v{niha} → v{nû}", "updating": "Tê rojanekirin..." }, + "region": { + "title": "Herêm" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index 1c891de9f..647dc6a17 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -1980,6 +1980,14 @@ "description": "Temperatuur in Fahrenheit weergeven in plaats van Celsius.", "label": "Temperatuur in Fahrenheit (°F) weergeven" }, + "hide-city": { + "description": "Verberg de stadsnaam in weerweergaven in de hele interface.", + "label": "Verberg stadsnaam" + }, + "hide-timezone": { + "description": "Verberg de tijdzone-afkorting in alle weerweergaves in de interface.", + "label": "Verberg tijdzone" + }, "section": { "description": "Kies je voorkeurseenheid voor temperatuur.", "label": "Weer" @@ -2013,9 +2021,6 @@ }, "title": "Vergrendelscherm" }, - "region": { - "title": "Regio" - }, "network": { "bluetooth": { "description": "Bluetooth-beheer activeren.", @@ -2340,6 +2345,9 @@ "update-version": "v{huidig} → v{nieuw}", "updating": "Bezig met updaten..." }, + "region": { + "title": "Regio" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/pl.json b/Assets/Translations/pl.json index d2adb9568..5d5bfae6f 100644 --- a/Assets/Translations/pl.json +++ b/Assets/Translations/pl.json @@ -1980,6 +1980,14 @@ "description": "Wyświetlaj temperaturę w stopniach Fahrenheita zamiast Celsjusza.", "label": "Pokaż temperaturę w Fahrenheitach (°F)" }, + "hide-city": { + "description": "Ukryj nazwę miasta na wyświetlaczach pogody w całym interfejsie.", + "label": "Ukryj nazwę miasta." + }, + "hide-timezone": { + "description": "Ukryj skrót strefy czasowej na wyświetlaczach pogody w całym interfejsie.", + "label": "Ukryj strefę czasową" + }, "section": { "description": "Wybierz preferowaną jednostkę temperatury.", "label": "Pogoda" @@ -2013,9 +2021,6 @@ }, "title": "Ekran blokady" }, - "region": { - "title": "Region" - }, "network": { "bluetooth": { "description": "Włącz zarządzanie Bluetooth.", @@ -2340,6 +2345,9 @@ "update-version": "v{current} → v{new}", "updating": "Aktualizowanie {plugin}..." }, + "region": { + "title": "Region" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 04ec293d3..f37f13c5c 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1980,6 +1980,14 @@ "description": "Exibe a temperatura em Fahrenheit em vez de Celsius.", "label": "Exibir temperatura em Fahrenheit (°F)" }, + "hide-city": { + "description": "Oculte o nome da cidade das exibições de clima em toda a interface.", + "label": "Ocultar nome da cidade" + }, + "hide-timezone": { + "description": "Oculte a abreviação do fuso horário das exibições de clima em toda a interface.", + "label": "Ocultar fuso horário" + }, "section": { "description": "Escolha sua unidade de temperatura preferida.", "label": "Clima" @@ -2013,9 +2021,6 @@ }, "title": "Tela de bloqueio" }, - "region": { - "title": "Região" - }, "network": { "bluetooth": { "description": "Ativar gerenciamento de Bluetooth.", @@ -2340,6 +2345,9 @@ "update-version": "v{atual} → v{novo}", "updating": "Atualizando..." }, + "region": { + "title": "Região" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index d6484480b..f149e6efd 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -1980,6 +1980,14 @@ "description": "Отображать температуру в Фаренгейтах вместо Цельсия.", "label": "Отображать температуру в Фаренгейтах (°F)" }, + "hide-city": { + "description": "Скрыть название города из отображения погоды во всем интерфейсе.", + "label": "Скрыть название города" + }, + "hide-timezone": { + "description": "Скрыть аббревиатуру часового пояса из отображения погоды во всем интерфейсе.", + "label": "Скрыть часовой пояс" + }, "section": { "description": "Выберите предпочитаемую единицу измерения температуры.", "label": "Погода" @@ -2013,9 +2021,6 @@ }, "title": "Экран блокировки" }, - "region": { - "title": "Регион" - }, "network": { "bluetooth": { "description": "Включить управление Bluetooth.", @@ -2340,6 +2345,9 @@ "update-version": "v{текущее} → v{новое}", "updating": "Обновление..." }, + "region": { + "title": "Регион" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index ae4a8a419..42825e692 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -1980,6 +1980,14 @@ "description": "Sıcaklığı santigrat yerine fahrenhayt cinsinden gösterin.", "label": "Sıcaklığı fahrenhayt (°F) cinsinden göster" }, + "hide-city": { + "description": "Arayüzün tamamında hava durumu ekranlarında şehir adını gizle.", + "label": "Şehir adını gizle" + }, + "hide-timezone": { + "description": "Arayüzün tamamındaki hava durumu ekranlarından saat dilimi kısaltmasını gizle.", + "label": "Saat dilimini gizle" + }, "section": { "description": "Tercih ettiğiniz sıcaklık birimini seçin.", "label": "Hava durumu" @@ -2013,9 +2021,6 @@ }, "title": "Ekran Kilit" }, - "region": { - "title": "Bölge" - }, "network": { "bluetooth": { "description": "Bluetooth yönetimini etkinleştir.", @@ -2340,6 +2345,9 @@ "update-version": "v{mevcut} → v{yeni}", "updating": "Güncelleniyor..." }, + "region": { + "title": "Bölge" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index 6c1978fb9..5c3763938 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -1980,6 +1980,14 @@ "description": "Відображати температуру в Фаренгейтах замість Цельсія.", "label": "Відображати температуру в Фаренгейтах (°F)" }, + "hide-city": { + "description": "Приховати назву міста з відображення погоди в усьому інтерфейсі.", + "label": "Приховати назву міста" + }, + "hide-timezone": { + "description": "Приховати абревіатуру часового поясу з відображення погоди в усьому інтерфейсі.", + "label": "Приховати часовий пояс" + }, "section": { "description": "Виберіть бажану одиницю температури.", "label": "Погода" @@ -2013,9 +2021,6 @@ }, "title": "Екран блокування" }, - "region": { - "title": "Регіон" - }, "network": { "bluetooth": { "description": "Активувати керування Bluetooth.", @@ -2340,6 +2345,9 @@ "update-version": "v{current} → v{new}", "updating": "Оновлення..." }, + "region": { + "title": "Регіон" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 610d51d83..ba10552f7 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1980,6 +1980,14 @@ "description": "以华氏度而非摄氏度显示温度。", "label": "以华氏度显示温度 (°F)" }, + "hide-city": { + "description": "在整个界面中隐藏天气显示中的城市名称。", + "label": "隐藏城市名称" + }, + "hide-timezone": { + "description": "在整个界面中,隐藏天气显示中的时区缩写。", + "label": "隐藏时区" + }, "section": { "description": "选择您喜欢的温度单位。", "label": "天气" @@ -2013,9 +2021,6 @@ }, "title": "锁屏" }, - "region": { - "title": "地区" - }, "network": { "bluetooth": { "description": "启用蓝牙管理。", @@ -2340,6 +2345,9 @@ "update-version": "v{当前} → v{新}", "updating": "正在更新..." }, + "region": { + "title": "地区" + }, "screen-recorder": { "audio": { "audio-codec": { diff --git a/Commons/Settings.qml b/Commons/Settings.qml index e875d798c..376dfe6d7 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -319,6 +319,8 @@ Singleton { property bool showCalendarWeather: true property bool analogClockInCalendar: false property int firstDayOfWeek: -1 // -1 = auto (use locale), 0 = Sunday, 1 = Monday, 6 = Saturday + property bool hideWeatherTimezone: false + property bool hideWeatherCityName: false } // calendar diff --git a/Modules/Cards/CalendarHeaderCard.qml b/Modules/Cards/CalendarHeaderCard.qml index 0ee04496b..1911e99bd 100644 --- a/Modules/Cards/CalendarHeaderCard.qml +++ b/Modules/Cards/CalendarHeaderCard.qml @@ -92,6 +92,8 @@ Rectangle { return ""; if (!root.weatherReady) return I18n.tr("calendar.weather.loading"); + if (Settings.data.location.hideWeatherCityName) + return ""; const chunks = Settings.data.location.name.split(","); return chunks[0]; } @@ -102,7 +104,7 @@ Rectangle { } NText { - text: root.weatherReady ? ` (${LocationService.data.weather.timezone_abbreviation})` : "" + text: root.weatherReady && !Settings.data.location.hideWeatherTimezone ? ` (${LocationService.data.weather.timezone_abbreviation})` : "" pointSize: Style.fontSizeXS color: Qt.alpha(Color.mOnPrimary, 0.7) } diff --git a/Modules/Cards/WeatherCard.qml b/Modules/Cards/WeatherCard.qml index 1ff5ec640..c3fdcf306 100644 --- a/Modules/Cards/WeatherCard.qml +++ b/Modules/Cards/WeatherCard.qml @@ -102,7 +102,7 @@ NBox { } pointSize: Style.fontSizeL font.weight: Style.fontWeightBold - visible: showLocation + visible: showLocation && !Settings.data.location.hideWeatherCityName } RowLayout { @@ -129,7 +129,7 @@ NBox { text: weatherReady ? `(${LocationService.data.weather.timezone_abbreviation})` : "" pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant - visible: LocationService.data.weather && showLocation + visible: LocationService.data.weather && showLocation && !Settings.data.location.hideWeatherTimezone } } } diff --git a/Modules/DesktopWidgets/Widgets/DesktopWeather.qml b/Modules/DesktopWidgets/Widgets/DesktopWeather.qml index e0211b670..6582a562e 100644 --- a/Modules/DesktopWidgets/Widgets/DesktopWeather.qml +++ b/Modules/DesktopWidgets/Widgets/DesktopWeather.qml @@ -89,6 +89,7 @@ DraggableDesktopWidget { color: Color.mOnSurfaceVariant elide: Text.ElideRight maximumLineCount: 1 + visible: !Settings.data.location.hideWeatherCityName } RowLayout { diff --git a/Modules/LockScreen/LockScreen.qml b/Modules/LockScreen/LockScreen.qml index e5a13b5a6..462f35bd7 100644 --- a/Modules/LockScreen/LockScreen.qml +++ b/Modules/LockScreen/LockScreen.qml @@ -890,6 +890,7 @@ Loader { text: Settings.data.location.name.split(",")[0] pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant + visible: !Settings.data.location.hideWeatherCityName } NText { diff --git a/Modules/Panels/Settings/Tabs/RegionTab.qml b/Modules/Panels/Settings/Tabs/RegionTab.qml index ffd7e222f..d9b06ba36 100644 --- a/Modules/Panels/Settings/Tabs/RegionTab.qml +++ b/Modules/Panels/Settings/Tabs/RegionTab.qml @@ -177,6 +177,22 @@ ColumnLayout { onToggled: checked => Settings.data.location.weatherShowEffects = checked enabled: Settings.data.location.weatherEnabled } + + NToggle { + label: I18n.tr("settings.location.weather.hide-city.label") + description: I18n.tr("settings.location.weather.hide-city.description") + checked: Settings.data.location.hideWeatherCityName + onToggled: checked => Settings.data.location.hideWeatherCityName = checked + enabled: Settings.data.location.weatherEnabled + } + + NToggle { + label: I18n.tr("settings.location.weather.hide-timezone.label") + description: I18n.tr("settings.location.weather.hide-timezone.description") + checked: Settings.data.location.hideWeatherTimezone + onToggled: checked => Settings.data.location.hideWeatherTimezone = checked + enabled: Settings.data.location.weatherEnabled + } } NDivider {