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:
parent
1313b899ad
commit
4be8fc9693
4 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue