Cannot anchor Page children to the page

Bug #1249386 reported by Sebastien Bacher
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Critical
Tim Peeters
ubuntu-ui-toolkit (Ubuntu)
Fix Released
Undecided
Tim Peeters

Bug Description

The attached code snipped works fine on saucy, it stops working (the list items are not displayed) once upgrading to the current daily-build toolkit version

Related branches

Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: nobody → Florian Boucault (fboucault)
Changed in ubuntu-ui-toolkit:
assignee: nobody → Florian Boucault (fboucault)
Revision history for this message
Florian Boucault (fboucault) wrote :

Saucy's version is 0.1.46+13.10.20131011.2-0ubuntu1 aka. bzr revision 793. Testing this sample program I can confirm that something has changed: it used to work, it does not anymore.

Changed in ubuntu-ui-toolkit:
assignee: Florian Boucault (fboucault) → nobody
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Florian Boucault (fboucault) wrote :

Determining where the issue lies: application code that should never have worked in the first place or toolkit regression?

Revision history for this message
Florian Boucault (fboucault) wrote :

One visible difference is that with the latest trunk the following warning is outputted to the console:
file:///home/kaleo/emptylist.qml:30:13: QML Flickable: Cannot anchor to an item that isn't a parent or sibling.

Revision history for this message
Florian Boucault (fboucault) wrote :

That warning is caused by line:

                anchors.bottom: soundsPage.bottom

which should be working so we can safely say that this is a regression in the toolkit.

Bumping to critical.

Changed in ubuntu-ui-toolkit:
importance: High → Critical
status: Confirmed → In Progress
Revision history for this message
Florian Boucault (fboucault) wrote :

Reverting revision 819 fixes the issue.

Revision history for this message
Florian Boucault (fboucault) wrote :

Revision 819 was fixing bug 1223604

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

In 819, internally the Page adds a container to which the contents is added. This was done to have a MouseArea on top of that area (and only that area, not over toolbar or header) to detect apps clicks. So in the app code, it should anchor to parent.bottom, not soundspage.bottom.

Revision history for this message
Florian Boucault (fboucault) wrote :

True. Though it is unexpected that the Page is not the parent.

Revision history for this message
Florian Boucault (fboucault) wrote :

I don't understand something though. In the Page code I see:

    Item {
        id: contentsItem
        anchors.fill: parent
    }

    MouseArea {
        id: contentsArea
        anchors.fill: contentsItem
        [...]

That means that contentsArea will invariably cover contentsItem's parent which is the page, no?

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

FYI, we use the same construction in MainView, Tabs, Toolbar, Dialog, Popover, Sheet, all list items.

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

So instead of the current construction in Page, we can set the z-value of the MouseArea.

Also need to add a regression test.

Changed in ubuntu-ui-toolkit:
assignee: Florian Boucault (fboucault) → Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: Florian Boucault (fboucault) → Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
importance: Critical → High
importance: High → Critical
Tim Peeters (tpeeters)
summary: - Elements not displayed since update
+ Cannot anchor Page children to the page
Revision history for this message
Tim Peeters (tpeeters) wrote :

Simpler test program to reproduce the bug:

import QtQuick 2.0
import Ubuntu.Components 0.1

MainView {
    width: units.gu(20)
    height: units.gu(40)

    Page {
        id: page
        Rectangle {
            color: "red"
            anchors.fill: page
        }
    }
}

Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

This was released as part of this release (just missing the bug reference in the upload):

ubuntu-ui-toolkit (0.1.46+14.04.20131108.4-0ubuntu1) trusty; urgency=low

  [ Robert Bruce Park ]
  * (no message)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 830

https://launchpad.net/ubuntu/trusty/+source/ubuntu-ui-toolkit/0.1.46+14.04.20131108.4-0ubuntu1

Changed in ubuntu-ui-toolkit (Ubuntu):
status: Fix Committed → Fix Released
Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
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.