feat: allow different systems for weather/performance (#1109)

* Allow different systems for weather/performance

Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com>

* readme: update options

Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com>

---------

Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com>
This commit is contained in:
Evertiro 2026-02-20 00:32:09 -06:00 committed by GitHub
parent 1313b899ad
commit 4be8fc9693
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 1 deletions

View file

@ -596,6 +596,7 @@ default, you must create it manually.
"playerAliases": [{ "from": "com.github.th_ch.youtube_music", "to": "YT Music" }], "playerAliases": [{ "from": "com.github.th_ch.youtube_music", "to": "YT Music" }],
"weatherLocation": "", "weatherLocation": "",
"useFahrenheit": false, "useFahrenheit": false,
"useFahrenheitPerformance": false,
"useTwelveHourClock": false, "useTwelveHourClock": false,
"smartScheme": true, "smartScheme": true,
"visualiserBars": 45 "visualiserBars": 45

View file

@ -441,6 +441,7 @@ Singleton {
return { return {
weatherLocation: services.weatherLocation, weatherLocation: services.weatherLocation,
useFahrenheit: services.useFahrenheit, useFahrenheit: services.useFahrenheit,
useFahrenheitPerformance: services.useFahrenheitPerformance,
useTwelveHourClock: services.useTwelveHourClock, useTwelveHourClock: services.useTwelveHourClock,
gpuType: services.gpuType, gpuType: services.gpuType,
visualiserBars: services.visualiserBars, visualiserBars: services.visualiserBars,

View file

@ -4,6 +4,7 @@ import QtQuick
JsonObject { JsonObject {
property string weatherLocation: "" // A lat,long pair or empty for autodetection, e.g. "37.8267,-122.4233" property string weatherLocation: "" // A lat,long pair or empty for autodetection, e.g. "37.8267,-122.4233"
property bool useFahrenheit: [Locale.ImperialUSSystem, Locale.ImperialSystem].includes(Qt.locale().measurementSystem) property bool useFahrenheit: [Locale.ImperialUSSystem, Locale.ImperialSystem].includes(Qt.locale().measurementSystem)
property bool useFahrenheitPerformance: [Locale.ImperialUSSystem, Locale.ImperialSystem].includes(Qt.locale().measurementSystem)
property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a") property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a")
property string gpuType: "" property string gpuType: ""
property int visualiserBars: 45 property int visualiserBars: 45

View file

@ -13,7 +13,7 @@ Item {
readonly property int minWidth: 400 + 400 + Appearance.spacing.normal + 120 + Appearance.padding.large * 2 readonly property int minWidth: 400 + 400 + Appearance.spacing.normal + 120 + Appearance.padding.large * 2
function displayTemp(temp: real): string { function displayTemp(temp: real): string {
return `${Math.ceil(Config.services.useFahrenheit ? temp * 1.8 + 32 : temp)}°${Config.services.useFahrenheit ? "F" : "C"}`; return `${Math.ceil(Config.services.useFahrenheitPerformance ? temp * 1.8 + 32 : temp)}°${Config.services.useFahrenheitPerformance ? "F" : "C"}`;
} }
implicitWidth: Math.max(minWidth, content.implicitWidth) implicitWidth: Math.max(minWidth, content.implicitWidth)