From b8d17ad8efb797cae68cb7ad5679afb24efaf031 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 12 Apr 2026 22:47:30 +1000 Subject: [PATCH] fix: use global config for global properties --- modules/background/DesktopClock.qml | 2 +- modules/bar/components/Clock.qml | 2 +- modules/controlcenter/launcher/Settings.qml | 4 ++-- modules/dashboard/Performance.qml | 2 +- modules/dashboard/WeatherTab.qml | 2 +- modules/dashboard/dash/DateTime.qml | 2 +- modules/launcher/AppList.qml | 2 +- modules/launcher/Content.qml | 6 +++--- modules/launcher/ContentList.qml | 2 +- modules/launcher/items/AppItem.qml | 2 +- modules/launcher/items/CalcItem.qml | 2 +- modules/launcher/services/Actions.qml | 4 ++-- modules/launcher/services/Apps.qml | 2 +- modules/launcher/services/M3Variants.qml | 2 +- modules/launcher/services/Schemes.qml | 2 +- modules/lock/Center.qml | 2 +- modules/lock/WeatherInfo.qml | 2 +- modules/osd/Content.qml | 4 ++-- modules/utilities/cards/IdleInhibit.qml | 2 +- services/Weather.qml | 8 ++++---- 20 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/background/DesktopClock.qml b/modules/background/DesktopClock.qml index b7d22417..be6dff61 100644 --- a/modules/background/DesktopClock.qml +++ b/modules/background/DesktopClock.qml @@ -106,7 +106,7 @@ Item { Layout.alignment: Qt.AlignTop Layout.topMargin: Tokens.padding.large * 1.4 * root.clockScale - active: Config.services.useTwelveHourClock + active: GlobalConfig.services.useTwelveHourClock visible: active sourceComponent: StyledText { diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml index d6528c64..ffe599af 100644 --- a/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -62,7 +62,7 @@ StyledRect { anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: StyledText.AlignHCenter - text: Time.format(Config.services.useTwelveHourClock ? "hh\nmm\nA" : "hh\nmm") + text: Time.format(GlobalConfig.services.useTwelveHourClock ? "hh\nmm\nA" : "hh\nmm") font.pointSize: Tokens.font.size.smaller font.family: Tokens.font.family.mono color: root.colour diff --git a/modules/controlcenter/launcher/Settings.qml b/modules/controlcenter/launcher/Settings.qml index df25a827..657c4a28 100644 --- a/modules/controlcenter/launcher/Settings.qml +++ b/modules/controlcenter/launcher/Settings.qml @@ -100,13 +100,13 @@ ColumnLayout { PropertyRow { label: qsTr("Special prefix") - value: Config.launcher.specialPrefix || qsTr("None") + value: GlobalConfig.launcher.specialPrefix || qsTr("None") } PropertyRow { showTopMargin: true label: qsTr("Action prefix") - value: Config.launcher.actionPrefix || qsTr("None") + value: GlobalConfig.launcher.actionPrefix || qsTr("None") } } diff --git a/modules/dashboard/Performance.qml b/modules/dashboard/Performance.qml index 0c405fd3..cfed9296 100644 --- a/modules/dashboard/Performance.qml +++ b/modules/dashboard/Performance.qml @@ -14,7 +14,7 @@ Item { readonly property int minWidth: 400 + 400 + Tokens.spacing.normal + 120 + Tokens.padding.large * 2 function displayTemp(temp: real): string { - return `${Math.ceil(Config.services.useFahrenheitPerformance ? temp * 1.8 + 32 : temp)}°${Config.services.useFahrenheitPerformance ? "F" : "C"}`; + return `${Math.ceil(GlobalConfig.services.useFahrenheitPerformance ? temp * 1.8 + 32 : temp)}°${GlobalConfig.services.useFahrenheitPerformance ? "F" : "C"}`; } implicitWidth: Math.max(minWidth, content.implicitWidth) diff --git a/modules/dashboard/WeatherTab.qml b/modules/dashboard/WeatherTab.qml index 312372b2..3cf8d3b7 100644 --- a/modules/dashboard/WeatherTab.qml +++ b/modules/dashboard/WeatherTab.qml @@ -193,7 +193,7 @@ Item { StyledText { Layout.alignment: Qt.AlignHCenter - text: Config.services.useFahrenheit ? forecastItem.modelData.maxTempF + "°" + " / " + forecastItem.modelData.minTempF + "°" : forecastItem.modelData.maxTempC + "°" + " / " + forecastItem.modelData.minTempC + "°" + text: GlobalConfig.services.useFahrenheit ? forecastItem.modelData.maxTempF + "°" + " / " + forecastItem.modelData.minTempF + "°" : forecastItem.modelData.maxTempC + "°" + " / " + forecastItem.modelData.minTempC + "°" font.weight: 600 color: Colours.palette.m3tertiary } diff --git a/modules/dashboard/dash/DateTime.qml b/modules/dashboard/dash/DateTime.qml index 248d41f3..82bee151 100644 --- a/modules/dashboard/dash/DateTime.qml +++ b/modules/dashboard/dash/DateTime.qml @@ -51,7 +51,7 @@ Item { asynchronous: true Layout.alignment: Qt.AlignHCenter - active: Config.services.useTwelveHourClock + active: GlobalConfig.services.useTwelveHourClock visible: active sourceComponent: StyledText { diff --git a/modules/launcher/AppList.qml b/modules/launcher/AppList.qml index 52b9b1b5..ac5bea65 100644 --- a/modules/launcher/AppList.qml +++ b/modules/launcher/AppList.qml @@ -50,7 +50,7 @@ StyledListView { state: { const text = search.text; - const prefix = Config.launcher.actionPrefix; + const prefix = GlobalConfig.launcher.actionPrefix; if (text.startsWith(prefix)) { for (const action of ["calc", "scheme", "variant"]) if (text.startsWith(`${prefix}${action} `)) diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index 2ca41739..7e283c8f 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -78,7 +78,7 @@ Item { topPadding: Tokens.padding.larger bottomPadding: Tokens.padding.larger - placeholderText: qsTr("Type \"%1\" for commands").arg(Config.launcher.actionPrefix) + placeholderText: qsTr("Type \"%1\" for commands").arg(GlobalConfig.launcher.actionPrefix) onAccepted: { const currentItem = list.currentList?.currentItem; @@ -88,8 +88,8 @@ Item { Wallpapers.previewColourLock = true; Wallpapers.setWallpaper(currentItem.modelData.path); root.visibilities.launcher = false; - } else if (text.startsWith(Config.launcher.actionPrefix)) { - if (text.startsWith(`${Config.launcher.actionPrefix}calc `)) + } else if (text.startsWith(GlobalConfig.launcher.actionPrefix)) { + if (text.startsWith(`${GlobalConfig.launcher.actionPrefix}calc `)) currentItem.onClicked(); else currentItem.modelData.onClicked(list.currentList); diff --git a/modules/launcher/ContentList.qml b/modules/launcher/ContentList.qml index 4667a540..482d6c0d 100644 --- a/modules/launcher/ContentList.qml +++ b/modules/launcher/ContentList.qml @@ -18,7 +18,7 @@ Item { required property int padding required property int rounding - readonly property bool showWallpapers: search.text.startsWith(`${Config.launcher.actionPrefix}wallpaper `) + readonly property bool showWallpapers: search.text.startsWith(`${GlobalConfig.launcher.actionPrefix}wallpaper `) readonly property var currentList: showWallpapers ? wallpaperList.item : appList.item // Can be either ListView or PathView, so can't type properly anchors.horizontalCenter: parent.horizontalCenter diff --git a/modules/launcher/items/AppItem.qml b/modules/launcher/items/AppItem.qml index 7a399549..a78349cd 100644 --- a/modules/launcher/items/AppItem.qml +++ b/modules/launcher/items/AppItem.qml @@ -78,7 +78,7 @@ Item { asynchronous: true anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - active: root.modelData && Strings.testRegexList(Config.launcher.favouriteApps, root.modelData.id) + active: root.modelData && Strings.testRegexList(GlobalConfig.launcher.favouriteApps, root.modelData.id) sourceComponent: MaterialIcon { text: "favorite" diff --git a/modules/launcher/items/CalcItem.qml b/modules/launcher/items/CalcItem.qml index 66882991..534b6c10 100644 --- a/modules/launcher/items/CalcItem.qml +++ b/modules/launcher/items/CalcItem.qml @@ -10,7 +10,7 @@ Item { id: root required property var list - readonly property string math: list.search.text.slice(`${Config.launcher.actionPrefix}calc `.length) + readonly property string math: list.search.text.slice(`${GlobalConfig.launcher.actionPrefix}calc `.length) function onClicked(): void { Quickshell.execDetached(["wl-copy", Qalculator.rawResult]); diff --git a/modules/launcher/services/Actions.qml b/modules/launcher/services/Actions.qml index 30b8bb2c..13ec0361 100644 --- a/modules/launcher/services/Actions.qml +++ b/modules/launcher/services/Actions.qml @@ -11,7 +11,7 @@ Searcher { id: root function transformSearch(search: string): string { - return search.slice(Config.launcher.actionPrefix.length); + return search.slice(GlobalConfig.launcher.actionPrefix.length); } list: variants.instances @@ -39,7 +39,7 @@ Searcher { return; if (command[0] === "autocomplete" && command.length > 1) { - list.search.text = `${Config.launcher.actionPrefix}${command[1]} `; + list.search.text = `${GlobalConfig.launcher.actionPrefix}${command[1]} `; } else if (command[0] === "setMode" && command.length > 1) { list.visibilities.launcher = false; Colours.setMode(command[1]); diff --git a/modules/launcher/services/Apps.qml b/modules/launcher/services/Apps.qml index 57461ffb..ff05456b 100644 --- a/modules/launcher/services/Apps.qml +++ b/modules/launcher/services/Apps.qml @@ -24,7 +24,7 @@ Searcher { } function search(search: string): list { - const prefix = Config.launcher.specialPrefix; + const prefix = GlobalConfig.launcher.specialPrefix; if (search.startsWith(`${prefix}i `)) { keys = ["id", "name"]; diff --git a/modules/launcher/services/M3Variants.qml b/modules/launcher/services/M3Variants.qml index d7d7bf56..aa5d1ca7 100644 --- a/modules/launcher/services/M3Variants.qml +++ b/modules/launcher/services/M3Variants.qml @@ -10,7 +10,7 @@ Searcher { id: root function transformSearch(search: string): string { - return search.slice(`${Config.launcher.actionPrefix}variant `.length); + return search.slice(`${GlobalConfig.launcher.actionPrefix}variant `.length); } list: [ diff --git a/modules/launcher/services/Schemes.qml b/modules/launcher/services/Schemes.qml index 571cb101..bd2a10f7 100644 --- a/modules/launcher/services/Schemes.qml +++ b/modules/launcher/services/Schemes.qml @@ -14,7 +14,7 @@ Searcher { property string currentVariant function transformSearch(search: string): string { - return search.slice(`${Config.launcher.actionPrefix}scheme `.length); + return search.slice(`${GlobalConfig.launcher.actionPrefix}scheme `.length); } function selector(item: var): string { diff --git a/modules/lock/Center.qml b/modules/lock/Center.qml index be7bb22d..712e6709 100644 --- a/modules/lock/Center.qml +++ b/modules/lock/Center.qml @@ -58,7 +58,7 @@ ColumnLayout { Layout.leftMargin: Tokens.spacing.small Layout.alignment: Qt.AlignVCenter - active: Config.services.useTwelveHourClock + active: GlobalConfig.services.useTwelveHourClock visible: active sourceComponent: StyledText { diff --git a/modules/lock/WeatherInfo.qml b/modules/lock/WeatherInfo.qml index e76be9e6..d96a54df 100644 --- a/modules/lock/WeatherInfo.qml +++ b/modules/lock/WeatherInfo.qml @@ -159,7 +159,7 @@ ColumnLayout { StyledText { Layout.alignment: Qt.AlignHCenter - text: Config.services.useFahrenheit ? `${forecastHour.modelData?.tempF ?? 0}°F` : `${forecastHour.modelData?.tempC ?? 0}°C` + text: GlobalConfig.services.useFahrenheit ? `${forecastHour.modelData?.tempF ?? 0}°F` : `${forecastHour.modelData?.tempC ?? 0}°C` color: Colours.palette.m3secondary font.pointSize: Tokens.font.size.larger } diff --git a/modules/osd/Content.qml b/modules/osd/Content.qml index 012c4fe5..ff3295b7 100644 --- a/modules/osd/Content.qml +++ b/modules/osd/Content.qml @@ -46,7 +46,7 @@ Item { icon: Icons.getVolumeIcon(value, root.muted) value: root.volume - to: Config.services.maxVolume + to: GlobalConfig.services.maxVolume onMoved: Audio.setVolume(value) } } @@ -71,7 +71,7 @@ Item { icon: Icons.getMicVolumeIcon(value, root.sourceMuted) value: root.sourceVolume - to: Config.services.maxVolume + to: GlobalConfig.services.maxVolume onMoved: Audio.setSourceVolume(value) } } diff --git a/modules/utilities/cards/IdleInhibit.qml b/modules/utilities/cards/IdleInhibit.qml index bf80dee3..13d6f7a1 100644 --- a/modules/utilities/cards/IdleInhibit.qml +++ b/modules/utilities/cards/IdleInhibit.qml @@ -93,7 +93,7 @@ StyledRect { id: activeText anchors.centerIn: parent - text: qsTr("Active since %1").arg(Qt.formatTime(IdleInhibitor.enabledSince, Config.services.useTwelveHourClock ? "hh:mm a" : "hh:mm")) + text: qsTr("Active since %1").arg(Qt.formatTime(IdleInhibitor.enabledSince, GlobalConfig.services.useTwelveHourClock ? "hh:mm a" : "hh:mm")) color: Colours.palette.m3onPrimary font.pointSize: Math.round(Tokens.font.size.small * 0.9) } diff --git a/services/Weather.qml b/services/Weather.qml index e5037c40..504c0bbb 100644 --- a/services/Weather.qml +++ b/services/Weather.qml @@ -17,12 +17,12 @@ Singleton { readonly property string icon: cc ? Icons.getWeatherIcon(cc.weatherCode) : "cloud_alert" readonly property string description: cc?.weatherDesc ?? qsTr("No weather") - readonly property string temp: Config.services.useFahrenheit ? `${cc?.tempF ?? 0}°F` : `${cc?.tempC ?? 0}°C` - readonly property string feelsLike: Config.services.useFahrenheit ? `${cc?.feelsLikeF ?? 0}°F` : `${cc?.feelsLikeC ?? 0}°C` + readonly property string temp: GlobalConfig.services.useFahrenheit ? `${cc?.tempF ?? 0}°F` : `${cc?.tempC ?? 0}°C` + readonly property string feelsLike: GlobalConfig.services.useFahrenheit ? `${cc?.feelsLikeF ?? 0}°F` : `${cc?.feelsLikeC ?? 0}°C` readonly property int humidity: cc?.humidity ?? 0 readonly property real windSpeed: cc?.windSpeed ?? 0 - readonly property string sunrise: cc ? Qt.formatDateTime(new Date(cc.sunrise), Config.services.useTwelveHourClock ? "h:mm A" : "h:mm") : "--:--" - readonly property string sunset: cc ? Qt.formatDateTime(new Date(cc.sunset), Config.services.useTwelveHourClock ? "h:mm A" : "h:mm") : "--:--" + readonly property string sunrise: cc ? Qt.formatDateTime(new Date(cc.sunrise), GlobalConfig.services.useTwelveHourClock ? "h:mm A" : "h:mm") : "--:--" + readonly property string sunset: cc ? Qt.formatDateTime(new Date(cc.sunset), GlobalConfig.services.useTwelveHourClock ? "h:mm A" : "h:mm") : "--:--" readonly property var cachedCities: new Map()