mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-10-05 03:16:32 +08:00
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:
parent
d9d1c93bd0
commit
8dbebaa23c
@ -93,14 +93,16 @@ Cura.ExpandablePopup
|
|||||||
width: scroll.width - scroll.leftPadding - scroll.rightPadding
|
width: scroll.width - scroll.leftPadding - scroll.rightPadding
|
||||||
property real maximumHeight: UM.Theme.getSize("machine_selector_widget_content").height - buttonRow.height
|
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
|
popup.height = scroll.height + buttonRow.height
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted:
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
scroll.height = Math.min(height, maximumHeight)
|
scroll.height = Math.min(contentHeight, maximumHeight)
|
||||||
popup.height = scroll.height + buttonRow.height
|
popup.height = scroll.height + buttonRow.height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ import Cura 1.0 as Cura
|
|||||||
ListView
|
ListView
|
||||||
{
|
{
|
||||||
id: listView
|
id: listView
|
||||||
height: childrenRect.height
|
|
||||||
model: Cura.GlobalStacksModel {}
|
model: Cura.GlobalStacksModel {}
|
||||||
section.property: "hasRemoteConnection"
|
section.property: "hasRemoteConnection"
|
||||||
|
property real contentHeight: childrenRect.height
|
||||||
|
|
||||||
section.delegate: Label
|
section.delegate: Label
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user