[Page] Cannot scroll content if its height is less than page height

Bug #1189728 reported by Alberto Mardegan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Won't Fix
High
Tim Peeters

Bug Description

Please try the attached test case.

If the flickable contentItem.height is less (or equal) than the page height, scrolling is disabled. This is wrong, because the visible height assigned to the flickable is not the whole page, but the page minus the header.

If you uncomment the "// +1" from the Rectangle height, you'll see that this allows scrolling the contents, and by far more than 1 pixel only.

Also, once you enable scrolling, there are some worrying warnings about property binding loops which I'd highly recommend to investigate. :-)

Revision history for this message
Alberto Mardegan (mardy) wrote :
Changed in ubuntu-ui-toolkit:
importance: Undecided → High
assignee: nobody → Tim Peeters (tpeeters)
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
status: New → In Progress
Revision history for this message
Tim Peeters (tpeeters) wrote :

The behavior is correct. The relation between page height and flickable content height is not important, but the flickable cannot be scrolled if flickable.height == flickable.contentHeight. In your case your flickable fills the page, so the heights of the flickable and page happen to be the same.

When you set the height of the rectangle to the height of the flickable+1, you can scroll more than one pixel. This is because the rectangle is much higher than te page (which has a height of MainView.height - header.height).

The binding loop seems to be caused by something inside the Flickable. If you give the rectangle id: rect, and set the contentHeight of the flickable to rect.height, the binding loop warning disappears for me. I'm not sure what causes it, but it seems to be something internal in the Flickable.

Changed in ubuntu-ui-toolkit:
status: In Progress → Invalid
Revision history for this message
Alberto Mardegan (mardy) wrote :

Hi Tim, I don't understand what you wrote in the first paragraph; do you mean that the test case is wrong?

I suspect that you didn't understand the issue: please try with this one. You cannot scroll to see the green rectangle, if you remove the "+1".
If I'm doing something wrong with the test case, please tell me how to fix it :-)

Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
status: Invalid → In Progress
Revision history for this message
Tim Peeters (tpeeters) wrote :

you are right, there is an issue in the case that the height of the flickable equals its contentsheight and flickableDirection is set to: Flickable.AutoFlickDirection (default) - allows flicking vertically if the contentHeight is not equal to the height of the Flickable. Allows flicking horizontally if the contentWidth is not equal to the width of the Flickable.

when there is a flickable, the Page height is not changed to fit under the Header, but the flickable gets a topMargin instead. However, this margin is not taken into account in the Flickable when comparing height and contentHeight.

Trying to find a solution..

Revision history for this message
Tim Peeters (tpeeters) wrote :

The problem seems to be in Qt's Flickable, see https://bugreports.qt-project.org/browse/QTBUG-31905

Thanks Alberto for reporting it.

Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.