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