mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 17:57:16 +02:00
[GraphEditor] AttributeEditor: fix dynamic setting of attributes' height
By setting the height on the "onLoaded" event, no height update was possible unless the component was unloaded (which happens when "active" gets set to false) first and then reloaded (which happens when "active" gets set to true). If an attribute was to be hidden (by unchecking the "advanced attributes" checkbox, for example), its content was effectively hidden, but as its height was not being updated, a blank block remained in its place. Similarly, for attributes that are filled with a lot of content after being initialized (ChoiceParams, for example), the height was set once at the attribute's initialization but never updated afterwards.
This commit is contained in:
parent
091346cbb8
commit
6fdbf66607
1 changed files with 8 additions and 2 deletions
|
@ -34,8 +34,14 @@ ListView {
|
|||
onDoubleClicked: root.attributeDoubleClicked(mouse, attr)
|
||||
}
|
||||
|
||||
onLoaded: {
|
||||
height: item ? item.implicitHeight : -spacing // compensate for spacing if item is hidden
|
||||
onActiveChanged: height = active ? item.implicitHeight : -spacing
|
||||
|
||||
Connections {
|
||||
target: item
|
||||
function onImplicitHeightChanged() {
|
||||
// Handles cases where an attribute is created and its height is then updated as it is filled
|
||||
height = item.implicitHeight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue