Locked header does not work with conditional loading components

Bug #1424635 reported by Arthur Mello
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Fix Released
High
Tim Peeters
Vivid
Confirmed
Undecided
Unassigned

Bug Description

Trying to use the flickable property to make the header locked does not work as expected with conditional loading components. The attached sample QML code shows the issue. On the first tab, where the component is directly loaded, the header is locked and working as expected. On the second one the flickable component seems to be drawn over the header. The problem seems to be gone if we change the window height.

Related branches

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

I added some prints in our Page code. In Page10.qml (also valid for Page 1.1), I have this now:

    // avoid using parent.height because parent may be a Loader which does not have its height set.
    height: parentNode ? page.flickable ? parentNode.height : parentNode.height - internal.headerHeight : undefined
    onHeightChanged: print("height of "+page+" changed to "+parentNode.height+" - "+internal.headerHeight+" = "+height)

and this is being printed for the incorrect page:

qml: parent node of Page11_QMLTYPE_35(0x2779620) = Tab_QMLTYPE_26(0x217f4f0)
qml: parent height = 400
qml: height of Page11_QMLTYPE_35(0x2779620) changed to 400 - 72 = 328
qml: parent node of Page11_QMLTYPE_35(0x2779620) = Tab_QMLTYPE_26(0x217f4f0)
qml: parent height = 400
qml: height of Page11_QMLTYPE_35(0x2779620) changed to 400 - 72 = 400

so it seems that height is not updated, even though internal.headerHeight is correct here.

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

It is a problem here that the Loader has anchors, and thus width and height, and will set the width and height of its loaded item accordingly, overriding the logic we have in the Page.

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

I modified the example code like this: http://paste.ubuntu.com/10372933/ and now it works fine. It is not really a bug in UITK, but a result of how the UITK works and how the Loader changes the size of its children, see Loader sizing behavior on http://doc-snapshot.qt-project.org/qt5-5.4/qml-qtquick-loader.html

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

I linked an MR that fixes the issues and adds documentation to Tab.page.

With the fix from the MR, the test program works like this: http://paste.ubuntu.com/10388468/

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.7 KiB)

This bug was fixed in the package ubuntu-ui-toolkit - 1.2.1433+15.04.20150306-0ubuntu1

---------------
ubuntu-ui-toolkit (1.2.1433+15.04.20150306-0ubuntu1) vivid; urgency=medium

  [ Albert Astals Cid ]
  * Fix infinite icon size grow when asked for a non square icon
    Fixes: LP: #1422835
  * IconProvider: Make sure icons fit in the given size
  [ Christian Dywan ]
  * Skip select_text_longtap_when_active under opengles2.
    Fixes: LP: #1401140
  * Support for multiple devices with push_to_phone.sh.
  * Take OrientationHelper y coordinate from real parent height.
    Fixes: LP: #1413194
  * Update popover position upon pointer movement.
    Fixes: LP: #1199502, LP: #1415532
  * Change <code> to be inline-block. Fixes LP: #1427534
  * Set right anchor on tab overflow buttons. Fixes LP: #1425433
  * Add tst_listitems_itemselector.qml to EXCEPTIONS. So warnings are
    no longer fatal for unit test.
  [ Sebastien Bacher ]
  * document that MainView's applicationName is used to set the gettext
    domain. Fixes: LP: #1421661.
  [ Tiago Salem Herrmann ]
  * Drop cache once properties are successfully restored.
  [ Timo Jyrinki ]
  * Add dist-upgrade option to the UITK Test Plan script. Output the
    selected parameters in the beginning.
  [ Tim Peeters ]
  * Add MainView 1.2 which removes the deprecated toolbar support.
  * Enable PageStack header animations for MainView 1.2.
  * Fix the size and anchors of a Page that is loaded inside a Loader.
    This is useful when a Page is Loaded by a Tab. Fixes: LP: #1424635
  * Fix UITK gallery content page width.
    Fixes: LP: #1424635, LP: #1425470
  * Set objectName for MainView int est_textinput.header.qml and fix
    scenarios in test_textinput.py
  [ Zsombor Egri ]
  * Alarm services regression fix. Fixes: LP: #1401883
  * Implement ListItem dragging support in ListView.
    Fixes: LP: #119535
  * Introducing select/multiselect mode in ListItem.
  * Moving the tst_focus.qml under exceptions till we fix DatePicker
    binding loops.
  * RTL (Right To Left) support in ListItem.
  * RTM branch diff merge. Fixes: LP: #1358610.
  * Second stage of simplification - divider group property is an item,
    simplifying the anchoring of the contentItem. PropertyChange does
    not backup the property binding, uses QQmlPropertyPrivate::write()
    with parameter to keep bindings. ListItemAnimator uses behavior to
    animate snapping. Styling got "styledItem" context property to obey
    general styling rules. clicked() and pressAndHold() emission fix
    when content is swiped.
  * Transferring the ListItem attached properties to ListItemStyle API.
    Most of the style API became redundant, and removed. Few API from
    ListItem were also removed as not needed. ListItemAnimator,
    UCListItemAttached and UCActionPanel classes removed.
    Panel swiping overshoot made elastic. Snapping animation transformed
    into SmoothedAnimation, uses velocity of 60GU/second. Turning
    warnings to be reported in the error property.
    SHOW_SERVICEPROPERTIES_WARNINGS environment variable set will
    display them in the console. Fixes: LP: #1423203.
  * Updating documentation and imports for 1.2 & Vivid (Qt 5.4).
...

Read more...

Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-ui-toolkit (Ubuntu Vivid):
status: New → Confirmed
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.