mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:25:51 +08:00
Fix available space bug
Contributes to CL-1165
This commit is contained in:
parent
548882e398
commit
669f6d8f0c
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
import QtQuick 2.3
|
import QtQuick 2.3
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls 2.0
|
||||||
import QtQuick.Dialogs 1.1
|
|
||||||
import UM 1.3 as UM
|
import UM 1.3 as UM
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,7 +21,13 @@ Item
|
|||||||
id: popUp
|
id: popUp
|
||||||
|
|
||||||
// If the pop-up won't fit in the window, flip it
|
// 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
|
// Use dark grey for info blurbs and white for context menus
|
||||||
color: "#191919" // TODO: Theme!
|
color: "#191919" // TODO: Theme!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user