1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 07:22:50 -05:00

make screen to popouts for positioning data

This commit is contained in:
bbedward
2025-08-05 18:08:13 -04:00
parent bc11194454
commit 1bd4eeb736
14 changed files with 94 additions and 43 deletions

View File

@@ -15,6 +15,7 @@ Rectangle {
readonly property int compactContentWidth: Math.min(120, baseContentWidth)
property string section: "center"
property var popupTarget: null
property var parentScreen: null
signal clicked()
@@ -132,8 +133,10 @@ Rectangle {
onClicked: {
if (root.popupTarget && root.popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0);
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
root.popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, root.width, root.section);
var currentScreen = root.parentScreen || Screen;
var screenX = currentScreen.x || 0;
var relativeX = globalPos.x - screenX;
root.popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, root.width, root.section, currentScreen);
}
root.clicked();
}