aboutsummaryrefslogtreecommitdiffstats
path: root/config/quickshell/services/ConfigLoader.qml
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2025-06-16 03:02:21 -0300
committerGitHub <noreply@github.com>2025-06-16 03:02:21 -0300
commit0f70ff7ae24196ecf5cb9cf2c6299c2d2636a82b (patch)
tree3e24d5368222d0368348bb7aacd3ea7ce626622f /config/quickshell/services/ConfigLoader.qml
parent88abbee9fe56f2e2489f04a017daaf3cfdc97511 (diff)
parent1462996cc5256e6337eafc226423de5559214c7f (diff)
Merge pull request #743 from SherLock707/overviewV2_qs
Expose font size and family in config
Diffstat (limited to 'config/quickshell/services/ConfigLoader.qml')
-rw-r--r--config/quickshell/services/ConfigLoader.qml39
1 files changed, 35 insertions, 4 deletions
diff --git a/config/quickshell/services/ConfigLoader.qml b/config/quickshell/services/ConfigLoader.qml
index 051162d1..5f16bf55 100644
--- a/config/quickshell/services/ConfigLoader.qml
+++ b/config/quickshell/services/ConfigLoader.qml
@@ -29,7 +29,32 @@ Singleton {
try {
const json = JSON.parse(fileContent);
- ObjectUtils.applyToQtObject(ConfigOptions, json);
+ // Extract font configuration if it exists
+ let fontConfig = null;
+ let configForOptions = {};
+
+ // Copy all properties except font to configForOptions
+ for (let key in json) {
+ if (key !== "font") {
+ configForOptions[key] = json[key];
+ } else {
+ fontConfig = json[key];
+ }
+ }
+
+ // Apply the non-font configuration to ConfigOptions
+ ObjectUtils.applyToQtObject(ConfigOptions, configForOptions);
+
+ // Apply font configuration to Appearance if it exists
+ if (fontConfig && typeof Appearance !== 'undefined') {
+ if (fontConfig.family && Appearance.font && Appearance.font.family) {
+ ObjectUtils.applyToQtObject(Appearance.font.family, fontConfig.family);
+ }
+ if (fontConfig.pixelSize && Appearance.font && Appearance.font.pixelSize) {
+ ObjectUtils.applyToQtObject(Appearance.font.pixelSize, fontConfig.pixelSize);
+ }
+ }
+
if (root.firstLoad) {
root.firstLoad = false;
} else {
@@ -39,13 +64,19 @@ Singleton {
console.error("[ConfigLoader] Error reading file:", e);
Hyprland.dispatch(`exec notify-send "${qsTr("Shell configuration failed to load")}" "${root.filePath}"`)
return;
-
}
}
function setLiveConfigValue(nestedKey, value) {
let keys = nestedKey.split(".");
- let obj = ConfigOptions;
+ let targetObject = ConfigOptions;
+
+ // Check if this is a font-related configuration
+ if (keys[0] === "font" && typeof Appearance !== 'undefined') {
+ targetObject = Appearance;
+ }
+
+ let obj = targetObject;
let parents = [obj];
// Traverse and collect parent objects
@@ -113,4 +144,4 @@ Singleton {
}
}
}
-}
+} \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage