mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Fix available space bug
Contributes to CL-1165
This commit is contained in:
parent
548882e398
commit
669f6d8f0c
1 changed files with 7 additions and 2 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Dialogs 1.1
|
||||
import UM 1.3 as UM
|
||||
|
||||
/**
|
||||
|
@ -22,7 +21,13 @@ Item
|
|||
id: popUp
|
||||
|
||||
// If the pop-up won't fit in the window, flip it
|
||||
direction: target.y + target.height + contentWrapper.implicitHeight < monitorFrame.height ? "top" : "bottom"
|
||||
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"
|
||||
}
|
||||
|
||||
// Use dark grey for info blurbs and white for context menus
|
||||
color: "#191919" // TODO: Theme!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue