resource popout

This commit is contained in:
Zacharias-Brohn
2026-02-28 13:57:29 +01:00
parent 65adecfa21
commit b28eec5930
17 changed files with 1547 additions and 65 deletions
+4 -23
View File
@@ -23,13 +23,13 @@ RowLayout {
function checkPopout(x: real): void {
const ch = childAt(x, 2) as WrappedLoader;
if (!ch) {
if (!popouts.currentName.includes("traymenu"))
if (!ch || ch?.id === "spacer") {
if (!popouts.currentName.startsWith("traymenu"))
popouts.hasCurrent = false;
return;
}
if (visibilities.sidebar || visibilities.dashboard)
if (visibilities.sidebar || visibilities.dashboard || visibilities.resources)
return;
const id = ch.id;
@@ -41,26 +41,6 @@ RowLayout {
popouts.currentName = "audio";
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
popouts.hasCurrent = true;
} else if (id === "resources" && Config.barConfig.popouts.resources) {
popouts.currentName = "resources";
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
popouts.hasCurrent = true;
} else if (id === "tray" && Config.barConfig.popouts.tray) {
const index = Math.floor(((x - top) / item.implicitWidth) * item.items.count);
const trayItem = item.items.itemAt(index);
if (trayItem) {
// popouts.currentName = `traymenu${ index }`;
// popouts.currentCenter = Qt.binding( () => trayItem.mapToItem( root, trayItem.implicitWidth / 2, 0 ).x );
// popouts.hasCurrent = true;
} else {
// popouts.hasCurrent = false;
}
} else if (id === "clock" && Config.barConfig.popouts.clock) {
// Calendar.displayYear = new Date().getFullYear();
// Calendar.displayMonth = new Date().getMonth();
// popouts.currentName = "calendar";
// popouts.currentCenter = Qt.binding( () => item.mapToItem( root, itemWidth / 2, 0 ).x );
// popouts.hasCurrent = true;
} else if (id === "network" && Config.barConfig.popouts.network) {
popouts.currentName = "network";
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
@@ -142,6 +122,7 @@ RowLayout {
delegate: WrappedLoader {
sourceComponent: Resources {
visibilities: root.visibilities
}
}
}