forked from Shinonome/dots-hyprland
bar: popups: fix and simplify positioning
This commit is contained in:
@@ -11,8 +11,6 @@ LazyLoader {
|
||||
id: root
|
||||
|
||||
property Item hoverTarget
|
||||
property real offsetY: -30
|
||||
property bool maskEnabled: true
|
||||
property Component contentComponent
|
||||
|
||||
active: hoverTarget && hoverTarget.containsMouse
|
||||
@@ -22,33 +20,25 @@ LazyLoader {
|
||||
visible: true
|
||||
color: "transparent"
|
||||
exclusiveZone: 0
|
||||
anchors.top: true
|
||||
|
||||
anchors.left: true
|
||||
anchors.top: !Config.options.bar.bottom
|
||||
anchors.bottom: Config.options.bar.bottom
|
||||
|
||||
implicitWidth: popupContent.implicitWidth
|
||||
implicitHeight: popupContent.implicitHeight
|
||||
|
||||
margins {
|
||||
left: hoverTarget
|
||||
? hoverTarget.mapToGlobal(Qt.point(
|
||||
(hoverTarget.width - popupContent.implicitWidth) / 2,
|
||||
0
|
||||
)).x
|
||||
: 0
|
||||
top: hoverTarget
|
||||
? hoverTarget.mapToGlobal(Qt.point(0, hoverTarget.height)).y + offsetY
|
||||
: 0
|
||||
left: root.QsWindow?.mapFromItem(
|
||||
root.hoverTarget,
|
||||
(root.hoverTarget.width - popupContent.implicitWidth) / 2, 0
|
||||
).x
|
||||
top: Appearance.sizes.hyprlandGapsOut
|
||||
bottom: Appearance.sizes.hyprlandGapsOut
|
||||
}
|
||||
|
||||
mask: maskEnabled ? popupMask : undefined
|
||||
WlrLayershell.namespace: "quickshell:styledPopup" //maybe this can fix with the popups not showing ?
|
||||
WlrLayershell.namespace: "quickshell:popup" //maybe this can fix with the popups not showing ?
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
Region {
|
||||
id: popupMask
|
||||
item: popupContent
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: popupContent
|
||||
sourceComponent: root.contentComponent
|
||||
|
||||
Reference in New Issue
Block a user