forked from qt-creator/qt-creator
EffectComposer: Fix scroll to end when adding a node
Change-Id: Id13a825cedfe98500337d1914bda064c2f5e3bb3 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -145,6 +145,8 @@ ColumnLayout {
|
||||
color: StudioTheme.Values.themeToolbarBackground
|
||||
|
||||
EffectNodesComboBox {
|
||||
id: nodesComboBox
|
||||
|
||||
mainRoot: root
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -197,6 +199,14 @@ ColumnLayout {
|
||||
clip: true
|
||||
interactive: !HelperWidgets.Controller.contextMenuOpened
|
||||
|
||||
onContentHeightChanged: {
|
||||
if (nodesComboBox.nodeJustAdded && scrollView.contentItem.height > scrollView.height) {
|
||||
let lastItemH = repeater.itemAt(repeater.count - 1).height
|
||||
scrollView.contentY = scrollView.contentItem.height - lastItemH
|
||||
nodesComboBox.nodeJustAdded = false
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: nodesCol
|
||||
width: scrollView.width
|
||||
|
@@ -22,6 +22,8 @@ StudioControls.ComboBox {
|
||||
|
||||
readonly property int popupHeight: Math.min(800, row.height + 2)
|
||||
|
||||
property bool nodeJustAdded: false
|
||||
|
||||
function calculateWindowGeometry() {
|
||||
var globalPos = EffectComposerBackend.rootView.globalPos(mainRoot.mapFromItem(root, 0, 0))
|
||||
var screenRect = EffectComposerBackend.rootView.screenRect();
|
||||
@@ -117,6 +119,7 @@ StudioControls.ComboBox {
|
||||
onAddEffectNode: (nodeQenPath) => {
|
||||
EffectComposerBackend.rootView.addEffectNode(modelData.nodeQenPath)
|
||||
root.popup.close()
|
||||
root.nodeJustAdded = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user