Fix binding loop with height of tiles

The lining at the bottom of a tile was anchored to the bottom but part of the tile and part of its childrenRect. This caused a binding loop because the childrenRect is dependent on the positioning of this lining (and its height) and the positioning of the lining was dependent on the height of the tile.

Contributes to issue CURA-5035.
This commit is contained in:
Ruben D 2018-05-02 14:27:30 +02:00
parent 2291164a6d
commit f7ca8cbf68
No known key found for this signature in database
GPG key ID: 6B42C9465E304A62

View file

@ -11,10 +11,7 @@ Item
id: tile id: tile
property bool installed: toolbox.isInstalled(model.id) property bool installed: toolbox.isInstalled(model.id)
width: detailList.width - UM.Theme.getSize("wide_margin").width width: detailList.width - UM.Theme.getSize("wide_margin").width
// TODO: Without this line, every instance of this object has 0 height. With height: Math.max(UM.Theme.getSize("toolbox_detail_tile").height, childrenRect.height + UM.Theme.getSize("default_margin").height)
// it, QML spits out tons of bugs claiming a binding loop (not true). Why?
// Because QT is garbage.
height: Math.max( UM.Theme.getSize("toolbox_detail_tile").height, childrenRect.height + UM.Theme.getSize("default_margin").height)
Item Item
{ {
id: normalData id: normalData
@ -238,7 +235,8 @@ Item
color: UM.Theme.getColor("lining") color: UM.Theme.getColor("lining")
width: tile.width width: tile.width
height: UM.Theme.getSize("default_lining").height height: UM.Theme.getSize("default_lining").height
anchors.bottom: tile.bottom anchors.top: supportedConfigsChart.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items.
} }
Connections Connections
{ {