Merge lp:~ajalkane/ubuntu-filemanager-app/scroll-places-pullover into lp:ubuntu-filemanager-app

Proposed by Arto Jalkanen
Status: Merged
Approved by: Niklas Wenzel
Approved revision: 362
Merged at revision: 362
Proposed branch: lp:~ajalkane/ubuntu-filemanager-app/scroll-places-pullover
Merge into: lp:ubuntu-filemanager-app
Diff against target: 14 lines (+2/-0)
1 file modified
src/app/qml/ui/PlacesPage.qml (+2/-0)
To merge this branch: bzr merge lp:~ajalkane/ubuntu-filemanager-app/scroll-places-pullover
Reviewer Review Type Date Requested Status
Niklas Wenzel (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+245653@code.launchpad.net

Commit message

Bug #1407927: Fixed places pullover to be scrollable.

Description of the change

Bug #1407927: Fixed places pullover to be scrollable.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Thank you very much, Arto!

I gave your fix a go and it also seemed to work even without the changes to the Repeater. Is there any specific reason why they are needed? I'm inclined to believe that the Column already changes its height accordingly...

review: Needs Information
Revision history for this message
Arto Jalkanen (ajalkane) wrote :

The changes to repeater are needed - repeater does not have intrinsic height or width as it can't know how its items are laid. So we have to provide them to it.

WHy it seemed to work for you is because you didn't test all the cases. Resize the window small enough so that you can scroll it. You'll notice after scrolling the view always returns to start - because Repeater doesn't have height.

Revision history for this message
Niklas Wenzel (nikwen) wrote :

Well, would you mind giving it a go without the changes to the Repeater? It's working perfectly for me without them.

The reason for this is that the child items created by the Repeater are added to the Column, which means that the height of the Column changes accordingly. Therefore, you do not need to set the Repeater's height.
If you still don't believe me, add the following line to the Flickable:

onContentHeightChanged: console.log(contentHeight)

You'll see that even without the changes to the Repeater the log output looks like this:

qml: 0
qml: 48
qml: 96
qml: 144
qml: 192
qml: 240
[…]

That's the beauty of a Repeater inside a Column. ;)

review: Needs Fixing
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Here's the respective passage from the docs:

"Items instantiated by the Repeater are inserted, in order, as children of the Repeater's parent."

(http://developer.ubuntu.com/api/qml/sdk-14.10/QtQuick.Repeater)

Revision history for this message
Arto Jalkanen (ajalkane) wrote :

Hi,

I don't of course mind trying again and the documents you quote would indicate it should work as you said. I did originally try without those changes in Repeater, but it's of course possible I did some other needed changes afterwards.

I'll report back or push an update.

Thanks for the detailed look into this Niklas!

362. By Arto Jalkanen

Removed unnecessary code.

Revision history for this message
Arto Jalkanen (ajalkane) wrote :

You were totally right Niklas.

I removed the code that's not needed. Thank you!

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Thank you for looking into it again, Arto. The MP looks fine now. Let's get it merged! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/ui/PlacesPage.qml'
2--- src/app/qml/ui/PlacesPage.qml 2015-01-01 20:43:56 +0000
3+++ src/app/qml/ui/PlacesPage.qml 2015-01-06 19:56:47 +0000
4@@ -32,8 +32,10 @@
5 Flickable {
6 objectName: "placesFlickable"
7 anchors.fill: parent
8+ contentHeight: content.height
9
10 Column {
11+ id: content
12 anchors {
13 left: parent.left
14 right: parent.right

Subscribers

People subscribed via source and target branches