Open wallpaper picker from launcher, apply on click, move media bar options to module cog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-10-13 15:30:17 +02:00
1 parent e71ce9c0a4
commit 2e80ef1181
10 files changed
+49 -79

No files matched your search

+18 -1
View File
@@ -23,18 +23,35 @@ Item {
// manifest schema (boolean / integer / number / string / choices).
function fieldsFor(id) {
if (!ModuleRegistry.isPlugin(id))
return (ModuleRegistry.optionSchemas[id] || []).map(f => Object.assign({type:"choice"}, f));
return (ModuleRegistry.optionSchemas[id] || []).map(f => Object.assign({type:"choice"}, f)).concat(ModuleRegistry.sharedOptions[id] || []);
return PluginService.schema(String(id).slice(7)).filter(f => f && f.key).map(f => {
const choices = Array.isArray(f.choices) ? f.choices : Array.isArray(f.options) ? f.options.map(o => typeof o === "object" ? o.value : o) : null;
return Object.assign({}, f, {label: f.label || f.key, type: choices ? "choice" : (f.type || "string"), choices: choices || []});
});
}
function valueOf(entry, field) {
if (field.setting)
return ConfigService.value(field.setting);
if (field.module)
return root.modules.some(m => m.id === field.module && m.enabled);
if (!ModuleRegistry.isPlugin(entry.id))
return ModuleRegistry.option(entry, field.key);
return PluginService.widgetSettings(String(entry.id).slice(7), entry.options)[field.key];
}
function setOption(entry, key, value) {
const field = root.fieldsFor(entry.id).find(f => f.key === key) || {};
if (field.setting)
return ConfigService.setValue(field.setting, value);
if (field.module) {
// Toggle the companion module, adding it right after this one the first time.
if (root.modules.some(m => m.id === field.module))
return root.save(Logic.editModule(root.modules, field.module, "enabled", value));
if (!value)
return;
const list = root.modules.slice();
list.splice(list.findIndex(m => m.id === entry.id) + 1, 0, {id: field.module, position: entry.position, enabled: true});
return root.save(list);
}
root.save(Logic.editModule(root.modules, entry.id, "options", Object.assign({}, entry.options || {}, {[key]: value})));
}
readonly property var modules: BarLayout.modulesFor(screenName)