diff --git a/.config/quickshell/ii/modules/bar/BatteryIndicator.qml b/.config/quickshell/ii/modules/bar/BatteryIndicator.qml index ae907e42e..3cad9b2a5 100644 --- a/.config/quickshell/ii/modules/bar/BatteryIndicator.qml +++ b/.config/quickshell/ii/modules/bar/BatteryIndicator.qml @@ -95,23 +95,34 @@ MouseArea { } } - LazyLoader { + Loader { id: popupLoader active: root.containsMouse - component: PopupWindow { + sourceComponent: PanelWindow { id: popupWindow visible: true + color: "transparent" + exclusiveZone: 0 + + anchors.top: true + anchors.left: true + implicitWidth: batteryPopup.implicitWidth implicitHeight: batteryPopup.implicitHeight - anchor.item: root - anchor.rect.x: (root.implicitWidth - popupWindow.implicitWidth) / 2 - anchor.rect.y: Config.options.bar.bottom - ? (-batteryPopup.implicitHeight - 15) - : (root.implicitHeight + 15) - color: "transparent" + + margins { + left: root.mapToGlobal(Qt.point(0, 0)).x - batteryPopup.implicitWidth / 3 + top: root.mapToGlobal(Qt.point(0, root.height)).y - 30 + } + + mask: Region { + item: batteryPopup + } + BatteryPopup { id: batteryPopup + anchors.centerIn: parent } } }