quickshell and hyprland additions

This commit is contained in:
2026-03-15 13:56:00 +02:00
parent c9c27d1554
commit 1ad06b82a6
509 changed files with 68371 additions and 19 deletions

View File

@@ -0,0 +1,37 @@
import qs.config
import Quickshell
import QtQuick
import QtQuick.Layouts
RowLayout {
id: main
property string title: "Title"
property string description: "Description"
property string prefField: ''
ColumnLayout {
StyledText { text: main.title; font.pixelSize: Metrics.fontSize(16); }
StyledText { text: main.description; font.pixelSize: Metrics.fontSize(12); }
}
Item { Layout.fillWidth: true }
StyledSwitch {
// Safely resolve nested key (e.g. "background.showClock" or "bar.modules.some.setting")
checked: {
if (!main.prefField) return false;
var parts = main.prefField.split('.');
var cur = Config.runtime;
for (var i = 0; i < parts.length; ++i) {
if (cur === undefined || cur === null) return false;
cur = cur[parts[i]];
}
// If the config value is undefined, default to false
return cur === undefined || cur === null ? false : cur;
}
onToggled: {
// Persist change (updateKey will create missing objects)
Config.updateKey(main.prefField, checked);
}
}
}