hefty: bar: time widget

This commit is contained in:
end-4
2026-02-06 23:38:05 +01:00
parent 74368ad25a
commit 74c012c930
9 changed files with 177 additions and 18 deletions
@@ -7,21 +7,25 @@ import qs.modules.common.widgets as W
Repeater {
id: root
readonly property string invisibleItem: "_invisible"
required property list<var> componentNames
property string context: Quickshell.shellPath("modules/hefty/topLayer/bar/widgets")
model: {
const m = componentNames.map(item => {
if (item instanceof Array)
return ({"type": "container", "value": item});
else if (item === root.invisibleItem)
return ({"type": "invisible", "value": item});
else
return ({"type": "component", "value": item});
});
for (var i = 0;i < m.length; i++) {
const item = m[i];
if (item.type === "container") {
item.startSide = (i === 0) || (m[i - 1].type !== "container");
item.endSide = (i + 1 >= m.length) || (m[i + 1].type !== "container");
item.startSide = (i === 0) || (m[i - 1].type === "component");
item.endSide = (i + 1 >= m.length) || (m[i + 1].type === "component");
}
}
// print(JSON.stringify(m, null, 2));
@@ -29,6 +33,11 @@ Repeater {
}
delegate: DelegateChooser {
role: "type"
DelegateChoice {
roleValue: root.invisibleItem
delegate: Item { visible: false }
}
DelegateChoice {
roleValue: "component"