1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

dankbar: add generic bar widget IPC for popouts

fixes #750
This commit is contained in:
bbedward
2025-11-24 19:52:26 -05:00
parent d341a5a60b
commit fa98a27c90
5 changed files with 278 additions and 27 deletions

View File

@@ -186,6 +186,32 @@ Item {
}
}
function triggerPopout() {
if (pillClickAction) {
if (pillClickAction.length === 0) {
pillClickAction();
return;
}
const pill = isVertical ? verticalPill : horizontalPill;
const globalPos = pill.mapToGlobal(0, 0);
const currentScreen = parentScreen || Screen;
const pos = SettingsData.getPopupTriggerPosition(globalPos, currentScreen, barThickness, pill.width);
pillClickAction(pos.x, pos.y, pos.width, section, currentScreen);
return;
}
if (!hasPopout)
return;
const pill = isVertical ? verticalPill : horizontalPill;
const globalPos = pill.visualContent.mapToGlobal(0, 0);
const currentScreen = parentScreen || Screen;
const barPosition = axis?.edge === "left" ? 2 : (axis?.edge === "right" ? 3 : (axis?.edge === "top" ? 0 : 1));
const pos = SettingsData.getPopupTriggerPosition(globalPos, currentScreen, barThickness, pill.visualWidth, barSpacing, barPosition, barConfig);
pluginPopout.setTriggerPosition(pos.x, pos.y, pos.width, section, currentScreen, barPosition, barThickness, barSpacing, barConfig);
pluginPopout.toggle();
}
PluginPopout {
id: pluginPopout
contentWidth: root.popoutWidth