diff --git a/quickshell/Modules/DankBar/Popouts/VpnPopout.qml b/quickshell/Modules/DankBar/Popouts/VpnPopout.qml index 56347e5d..fc315fc1 100644 --- a/quickshell/Modules/DankBar/Popouts/VpnPopout.qml +++ b/quickshell/Modules/DankBar/Popouts/VpnPopout.qml @@ -17,7 +17,7 @@ DankPopout { property var triggerScreen: null popupWidth: 380 - popupHeight: Math.min(Screen.height - 100, contentLoader.item ? contentLoader.item.implicitHeight : 320) + popupHeight: Math.min((screen ? screen.height : Screen.height) - 100, contentLoader.item ? contentLoader.item.implicitHeight : 320) triggerWidth: 70 screen: triggerScreen shouldBeVisible: false diff --git a/quickshell/Modules/DankBar/Widgets/Vpn.qml b/quickshell/Modules/DankBar/Widgets/Vpn.qml index 543c389e..b70caff4 100644 --- a/quickshell/Modules/DankBar/Widgets/Vpn.qml +++ b/quickshell/Modules/DankBar/Widgets/Vpn.qml @@ -115,9 +115,19 @@ BasePill { const isLeft = root.axis?.edge === "left"; tooltipLoader.item.show(tooltipText, screenX + tooltipX, adjustedY, currentScreen, isLeft, !isLeft); } else { - const globalPos = mapToGlobal(width / 2, height); - const tooltipY = root.barThickness + root.barSpacing + Theme.spacingXS; - tooltipLoader.item.show(tooltipText, globalPos.x, tooltipY, root.parentScreen, false, false); + const isBottom = root.axis?.edge === "bottom"; + const globalPos = mapToGlobal(width / 2, 0); + const currentScreen = root.parentScreen || Screen; + + let tooltipY; + if (isBottom) { + const tooltipHeight = Theme.fontSizeSmall * 1.5 + Theme.spacingS * 2; + tooltipY = currentScreen.height - root.barThickness - root.barSpacing - Theme.spacingXS - tooltipHeight; + } else { + tooltipY = root.barThickness + root.barSpacing + Theme.spacingXS; + } + + tooltipLoader.item.show(tooltipText, globalPos.x, tooltipY, currentScreen, false, false); } } onExited: { diff --git a/quickshell/Widgets/DankPopout.qml b/quickshell/Widgets/DankPopout.qml index ebbd5b89..9b77dc86 100644 --- a/quickshell/Widgets/DankPopout.qml +++ b/quickshell/Widgets/DankPopout.qml @@ -145,6 +145,25 @@ Item { shouldBeVisible ? close() : open(); } + Connections { + target: Quickshell + function onScreensChanged() { + if (!shouldBeVisible || !screen) + return; + const currentScreenName = screen.name; + let screenStillExists = false; + for (let i = 0; i < Quickshell.screens.length; i++) { + if (Quickshell.screens[i].name === currentScreenName) { + screenStillExists = true; + break; + } + } + if (!screenStillExists) { + close(); + } + } + } + Timer { id: closeTimer interval: animationDuration