Ensure that the machine selector list scales properly

The old implementation directly listend to the height (instead of childrenRect).
This caused issues, since other things apart from adding / removing machines could
influence the height.

CURA-6060
This commit is contained in:
Jaime van Kessel 2018-12-31 13:14:08 +01:00
parent d9d1c93bd0
commit 8dbebaa23c
2 changed files with 6 additions and 4 deletions

View File

@ -93,14 +93,16 @@ Cura.ExpandablePopup
width: scroll.width - scroll.leftPadding - scroll.rightPadding
property real maximumHeight: UM.Theme.getSize("machine_selector_widget_content").height - buttonRow.height
onHeightChanged:
// We use an extra property here, since we only want to to be informed about the content size changes.
onContentHeightChanged:
{
scroll.height = Math.min(height, maximumHeight)
scroll.height = Math.min(contentHeight, maximumHeight)
popup.height = scroll.height + buttonRow.height
}
Component.onCompleted:
{
scroll.height = Math.min(height, maximumHeight)
scroll.height = Math.min(contentHeight, maximumHeight)
popup.height = scroll.height + buttonRow.height
}

View File

@ -10,9 +10,9 @@ import Cura 1.0 as Cura
ListView
{
id: listView
height: childrenRect.height
model: Cura.GlobalStacksModel {}
section.property: "hasRemoteConnection"
property real contentHeight: childrenRect.height
section.delegate: Label
{