QmlDesigner: Ensure item library content is visible

Make sure the ScrollView content area is visible after content size
changes.

Fixes: QDS-3795
Change-Id: I1f7408db9ad318a5c54b5186569dd04235a3d952
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2021-03-08 13:31:42 +02:00
parent fee671dfbe
commit 6fdb34994c

View File

@@ -87,6 +87,12 @@ ScrollView {
itemContextMenu.close()
}
onContentHeightChanged: {
var maxPosition = Math.max(contentHeight - height, 0)
if (contentY > maxPosition)
contentY = maxPosition
}
Item {
id: styleConstants
property int textWidth: 58