Commit 6089b939 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Constrain positioning and sizing of the popup within the bounds of the current calendar view



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent a3aa4194
Pipeline #230661 passed with stage
in 2 minutes and 1 second
......@@ -632,13 +632,15 @@ Kirigami.ApplicationWindow {
function onHeightChanged() { incidenceInfoPopup.reposition(); }
}
// Center the popup on the incidence item if possible
x: Math.min(incidenceItemMidXPoint - width / 2, maxXPosition)
// Center the popup on the incidence item if possible, but also ensure
// it is not going further left or right than the left and right edges
// of the current view
x: Math.max(0, Math.min(incidenceItemMidXPoint - width / 2, maxXPosition))
// Make sure not to cover up the incidence item
y: positionBelowIncidenceItem ?
incidenceItemPosition.y + openingIncidenceItem.height : incidenceItemPosition.y - height;
width: Kirigami.Units.gridUnit * 30
width: Math.min(pageStack.currentItem.width, Kirigami.Units.gridUnit * 30)
height: Math.min(Kirigami.Units.gridUnit * 50, scrollView.contentHeight)
onIncidenceDataChanged: root.openOccurrence = incidenceData
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment