Files
purian23 5623476126 feat(island): host the island as a widget in any bar configuration
- The island is now a bar widget so any bar can host one alongside the island layout and dot
- Routing got simpler: pick which shortcuts open here, the rest follow the shared rules
- IPC close/hide take down every surface showing the activity
- Qt 6.11 pointer prune workaround so the expanded island stays clickable
2026-09-27 02:02:30 -04:00

42 lines
1.2 KiB
QML

import QtQuick
import qs.Common
// Duck-typed store the Island*Cards read; a stand-in must expose config, setting, apply, isDefault and resetToDefault.
QtObject {
id: root
property string barId: ""
readonly property var config: {
SettingsData.barConfigs;
return SettingsData.getBarConfig(root.barId);
}
function setting(key) {
return SettingsData.islandSetting(root.config, key);
}
function apply(key, value) {
SettingsData.setIslandSettings(root.barId, {
[key]: value
});
}
function defaultFor(key) {
const defaults = SettingsData.islandDefaultsFor(root.config);
return key in defaults ? defaults[key] : SettingsData.barConfigDefault(key);
}
function isDefault(keys) {
const settings = SettingsData.islandSettings(root.config);
return keys.every(key => settings[key] === undefined || JSON.stringify(settings[key]) === JSON.stringify(defaultFor(key)));
}
function resetToDefault(keys) {
const patch = {};
for (const key of keys)
patch[key] = defaultFor(key);
SettingsData.setIslandSettings(root.barId, patch);
}
}