From f3e607c2cfe62d6bdb5177655a866ef02cd35711 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 1 Aug 2012 13:36:22 +0200 Subject: [PATCH] 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 --- declarativeimports/plasmacomponents/qml/ScrollBar.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/declarativeimports/plasmacomponents/qml/ScrollBar.qml b/declarativeimports/plasmacomponents/qml/ScrollBar.qml index 337cb3522..a5c338d6d 100644 --- a/declarativeimports/plasmacomponents/qml/ScrollBar.qml +++ b/declarativeimports/plasmacomponents/qml/ScrollBar.qml @@ -143,6 +143,9 @@ Item { Connections { target: flickableItem + onContentHeightChanged: { + range.value = flickableItem.contentY + } onContentYChanged: { if (internalLoader.isVertical) { range.value = flickableItem.contentY @@ -215,7 +218,7 @@ Item { id: updateFromHandleTimer interval: 10 onTriggered: { - if (internalLoader.isVertical) { + if (internalLoader.isVertical && enabled && interactive) { range.position = internalLoader.item.handle.y } else { range.position = internalLoader.item.handle.x