diff options
author | Sebastian Kügler <sebas@kde.org> | 2015-11-29 18:56:21 +0100 |
---|---|---|
committer | Sebastian Kügler <sebas@kde.org> | 2015-11-29 18:57:50 +0100 |
commit | 5e5c9830a48e8f9c0a376863b4fa17c7f5056af3 (patch) | |
tree | 2f2c8f89ce8c3cecad6b9f4279d94106b5cbe41d /qt-mobile/qml/mobilecomponents/PageRow.qml | |
parent | 6ffef818a8d34fdc8aef70c3515c2b91d8d297ac (diff) | |
download | subsurface-5e5c9830a48e8f9c0a376863b4fa17c7f5056af3.tar.gz |
Sync with upstream mobilecomponents
This updates to the state of bf7914b67c45e
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Diffstat (limited to 'qt-mobile/qml/mobilecomponents/PageRow.qml')
-rw-r--r-- | qt-mobile/qml/mobilecomponents/PageRow.qml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/qt-mobile/qml/mobilecomponents/PageRow.qml b/qt-mobile/qml/mobilecomponents/PageRow.qml index 941f77f73..4d6adf5a7 100644 --- a/qt-mobile/qml/mobilecomponents/PageRow.qml +++ b/qt-mobile/qml/mobilecomponents/PageRow.qml @@ -82,6 +82,7 @@ Item { // Returns the page instance. function push(page, properties, immediate) { + scrollAnimation.running = false; var item = Engine.push(page, properties, false, immediate) scrollToLevel(depth) return item @@ -93,6 +94,7 @@ Item { // Returns the page instance that was popped off the stack. function pop(page, immediate) { + scrollToLevel(depth-1); return Engine.pop(page, immediate); } @@ -100,6 +102,7 @@ Item { // See push() for details. function replace(page, properties, immediate) { + scrollAnimation.running = false; var item = Engine.push(page, properties, true, immediate); scrollToLevel(depth) return item @@ -128,8 +131,8 @@ Item { } var firstLevel = Math.max(0, level - mainFlickable.width/columnWidth + 1); - scrollAnimation.to = Math.max(0, Math.min(Math.max(0, columnWidth * (firstLevel - 1)), mainFlickable.contentWidth+1000)) - scrollAnimation.running = true + scrollAnimation.to = Math.max(0, Math.min(Math.max(0, columnWidth * (firstLevel - 1)), mainFlickable.contentWidth)); + scrollAnimation.running = true; } SequentialAnimation { @@ -173,6 +176,10 @@ Item { } } + onWidthChanged: { + var firstLevel = Math.max(0, depth - mainFlickable.width/columnWidth + 1); + mainFlickable.contentX = Math.max(0, Math.min(Math.max(0, columnWidth * (firstLevel - 1)), mainFlickable.contentWidth)); + } Component.onCompleted: { internal.completed = true if (initialPage && depth == 0) |