Code review comment for lp:~tpeeters/ubuntu-ui-toolkit/headerHeightInit

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

To clarify why the last change (removing the initializeFlickablePosition()) makes sense:

(MHeader = header of the mainview/page - this shows the current page title or the tabbar)
(LVHeader = the header inside the listview, specified by ListView.header property)

- In previous versions of the code, I used to set the contentY of the flickable to -MHeader.height,
because that ignored LVHeader, I then subtracted LVHeader.height from it.

- In the new version of the code, I don't set the contentY to -MHeader.height, but when MHeader.height is updated (or initialized), I SUBTRACT MHeader.height from contentY.

- It turns out that the listview already updates contentY when an LVHeader is used. In the previous version of our code, this update was overridden by setting the ListView.contentY to -MHeader.height, but now in the new version where we subtract MHeader.height from contentY instead of setting it, our code to accomodate for LVHeader.height in initializeFlickablePosition() is no longer needed. That's already done automatically by the ListView.

« Back to merge proposal