forked from Shinonome/dots-hyprland
use PanelWindow instead to show animation
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user