Pop-up flips directions

Contributes to CL-1165
This commit is contained in:
Ian Paschal 2019-01-10 15:27:04 +01:00
parent 0622c5cb8b
commit 9c711cc8aa
3 changed files with 131 additions and 63 deletions

View file

@ -20,14 +20,7 @@ Item
{
id: popUp
// If the pop-up won't fit in the window, flip it
direction:
{
var availableSpace = monitorFrame.height
var targetPosition = target.mapToItem(null, 0, 0)
var requiredSpace = targetPosition.y + target.height + contentWrapper.implicitHeight
return requiredSpace < availableSpace ? "top" : "bottom"
}
direction: "top"
// Use dark grey for info blurbs and white for context menus
color: "#191919" // TODO: Theme!