1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-22 19:15:24 -04:00

widgets: fix tooltip position mapping

This commit is contained in:
bbedward
2026-06-17 12:46:24 -04:00
parent 39301c534c
commit 29f19b07a9
7 changed files with 44 additions and 86 deletions
+5 -8
View File
@@ -106,18 +106,15 @@ BasePill {
}
if (root.isVerticalOrientation) {
const globalPos = mapToGlobal(width / 2, height / 2);
const localPos = mapToItem(null, width / 2, height / 2);
const currentScreen = root.parentScreen || Screen;
const screenX = currentScreen ? currentScreen.x : 0;
const screenY = currentScreen ? currentScreen.y : 0;
const relativeY = globalPos.y - screenY;
const adjustedY = relativeY + root.minTooltipY;
const adjustedY = localPos.y + root.minTooltipY;
const tooltipX = root.axis?.edge === "left" ? (root.barThickness + root.barSpacing + Theme.spacingXS) : (currentScreen.width - root.barThickness - root.barSpacing - Theme.spacingXS);
const isLeft = root.axis?.edge === "left";
tooltipLoader.item.show(tooltipText, screenX + tooltipX, adjustedY, currentScreen, isLeft, !isLeft);
tooltipLoader.item.show(tooltipText, tooltipX, adjustedY, currentScreen, isLeft, !isLeft);
} else {
const isBottom = root.axis?.edge === "bottom";
const globalPos = mapToGlobal(width / 2, 0);
const localPos = mapToItem(null, width / 2, 0);
const currentScreen = root.parentScreen || Screen;
let tooltipY;
@@ -128,7 +125,7 @@ BasePill {
tooltipY = root.barThickness + root.barSpacing + Theme.spacingXS;
}
tooltipLoader.item.show(tooltipText, globalPos.x, tooltipY, currentScreen, false, false);
tooltipLoader.item.show(tooltipText, localPos.x, tooltipY, currentScreen, false, false);
}
}
onExited: {