mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
bar: popups: fix and simplify positioning
This commit is contained in:
@@ -97,8 +97,6 @@ MouseArea {
|
||||
|
||||
StyledPopup {
|
||||
hoverTarget: root
|
||||
offsetY: -30
|
||||
maskEnabled: true
|
||||
contentComponent: BatteryPopup {
|
||||
id: batteryPopup
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -48,7 +48,6 @@ Item {
|
||||
|
||||
StyledPopup {
|
||||
hoverTarget: mouseArea
|
||||
offsetY: -30
|
||||
contentComponent: Rectangle {
|
||||
id: datePopup
|
||||
readonly property real margin: 12
|
||||
|
||||
@@ -70,7 +70,6 @@ Item {
|
||||
|
||||
StyledPopup {
|
||||
hoverTarget: mouseArea
|
||||
offsetY: -30
|
||||
contentComponent: Rectangle {
|
||||
id: resourcePopup
|
||||
readonly property real margin: 10
|
||||
|
||||
@@ -38,7 +38,6 @@ MouseArea {
|
||||
|
||||
StyledPopup {
|
||||
hoverTarget: root
|
||||
offsetY: -25
|
||||
contentComponent: WeatherPopup {
|
||||
id: weatherPopup
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -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