Improve response and behavior in ScrollBar

When contentHeight and contentY change at the same time, we got to
some weird states where the scrollbar would trigger a change in the
Flickable positioning that wasn't triggered by the user, this should
be fixed now.

Also don't use the handle position to move the Flickable scrolling
if the scrollbar is disabled or non-interactive. It shouldn't be needed
now but it helps keeping the complexity to a minimum.

REVIEW: 105808
This commit is contained in:
Aleix Pol 2012-08-01 13:36:22 +02:00
parent 0b9e172a88
commit f3e607c2cf

View File

@ -143,6 +143,9 @@ Item {
Connections { Connections {
target: flickableItem target: flickableItem
onContentHeightChanged: {
range.value = flickableItem.contentY
}
onContentYChanged: { onContentYChanged: {
if (internalLoader.isVertical) { if (internalLoader.isVertical) {
range.value = flickableItem.contentY range.value = flickableItem.contentY
@ -215,7 +218,7 @@ Item {
id: updateFromHandleTimer id: updateFromHandleTimer
interval: 10 interval: 10
onTriggered: { onTriggered: {
if (internalLoader.isVertical) { if (internalLoader.isVertical && enabled && interactive) {
range.position = internalLoader.item.handle.y range.position = internalLoader.item.handle.y
} else { } else {
range.position = internalLoader.item.handle.x range.position = internalLoader.item.handle.x