1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-20 01:55:20 -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
@@ -276,15 +276,12 @@ BasePill {
if (root.isVerticalOrientation && root.selectedMount) {
tooltipLoader.active = true;
if (tooltipLoader.item) {
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(root.selectedMount.mount, screenX + tooltipX, adjustedY, currentScreen, isLeft, !isLeft);
tooltipLoader.item.show(root.selectedMount.mount, tooltipX, adjustedY, currentScreen, isLeft, !isLeft);
}
}
}