Commit 66559a89 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fixed more errors in main.qml



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent 2fd7c24f
Pipeline #234115 passed with stage
in 2 minutes and 33 seconds
......@@ -501,7 +501,7 @@ Kirigami.ApplicationWindow {
}
}
contextDrawer: if(incidenceInfoDrawerEnabled) incidenceInfoDrawer
contextDrawer: incidenceInfoDrawerEnabled ? incidenceInfoDrawer : null
// Drawers inherit from popups too
readonly property QQC2.Popup incidenceInfoViewer: incidenceInfoDrawerEnabled ? incidenceInfoDrawer :
......@@ -610,7 +610,7 @@ Kirigami.ApplicationWindow {
property point incidenceItemPosition
property point clickPosition
property int incidenceItemMidXPoint: incidenceItemPosition ?
property int incidenceItemMidXPoint: incidenceItemPosition && openingIncidenceItem ?
incidenceItemPosition.x + openingIncidenceItem.width / 2 : 0
property bool positionBelowIncidenceItem: incidenceItemPosition &&
incidenceItemPosition.y < root.pageStack.currentItem.height / 2;
......@@ -642,12 +642,15 @@ Kirigami.ApplicationWindow {
// it is not going further left or right than the left and right edges
// of the current view
return Math.max(0, Math.min(incidenceItemMidXPoint - width / 2, maxXPosition));
}
const itemLeft = mapFromItem(openingIncidenceItem, 0, 0).x;
const itemRight = mapFromItem(openingIncidenceItem, openingIncidenceItem.width, 0).x;
} else if(openingIncidenceItem) {
const itemLeft = mapFromItem(openingIncidenceItem, 0, 0).x;
const itemRight = mapFromItem(openingIncidenceItem, openingIncidenceItem.width, 0).x;
return Math.max(itemLeft, Math.min(clickPosition.x, itemRight - width));
}
return Math.max(itemLeft, Math.min(clickPosition.x, itemRight - width));
return 0;
}
// Make sure not to cover up the incidence item
y: positionBelowIncidenceItem && openingIncidenceItem ? incidenceItemPosition.y + openingIncidenceItem.height : incidenceItemPosition.y - height;
......
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