Anchoring warnings in Buttons page in UITK Gallery

Bug #1620991 reported by Andrea Bernabei
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Medium
Zsombor Egri

Bug Description

ubuntu-ui-toolkit/staging, r2090

1) Build uitk
2) run gallery with ./gallery.sh
3) Open Buttons page

Expected outcome:
no warnings

Actual outcome:
A few "QML Scrollbar: Cannot anchor to an item that isn't a parent or sibling."

Explanation:
That happens because Scrollbar anchors to the flickable item, but the ComboButton code has a hack that changes the parent of the Flickable to actually be Flickable's child. As a consequence Flickable is not a sibling of the scrollbar anymore, thus producing the anchor-related warning.

See http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/annotate/2090/src/Ubuntu/Components/1.3/ComboButton.qml#L354

Andrea Bernabei (faenil)
summary: - Anchoring warnings in ComboButton page in UITK Gallery
+ Anchoring warnings in Buttons page in UITK Gallery
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: nobody → Zsombor Egri (zsombi)
importance: Undecided → Medium
Revision history for this message
Zsombor Egri (zsombi) wrote :

I can confirm that revision 2045 brought these warnings in.

http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/revision/2045

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
assignee: Zsombor Egri (zsombi) → Andrea Bernabei (faenil)
Revision history for this message
Zsombor Egri (zsombi) wrote :

This worked without any warnings before.

Revision history for this message
Andrea Bernabei (faenil) wrote :

rev2045 changes the order in which Scrollbar anchors to the flickable. since r2045 it waits for the flickable to be initialized before anchoring to it.

before:
Scrollbar anchors to flickable. Flickable parent changes, engine says nothing.

now:
Flickable is initialized, its parent changes. Scrollbar waits for flickable to be initialized, then anchors to it. QML engine notices that Flickable is not a sibling/parent, and warns about failed anchoring

My opinion:
I think we should double and triplecheck if we really need the flickable parent hack, otherwise we should remove it. An alternative could be to try and change the scrollbar parent at the same as the flickable parent changes, but I'm not sure that's going to prevent the warning from showing, as there should still be a moment when Flickable and Scrollbar are anchored but not in a relationship that allows anchoring one to the other.

Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: Andrea Bernabei (faenil) → Zsombor Egri (zsombi)
Revision history for this message
Zsombor Egri (zsombi) wrote :

The Flickable and the Scrollbar could be replaced with a ScrollView. The Flickable stays inactive if the ComboButton content is set to be an other Flickable. Having a ScrollView we could reparent it to the visual's dropdown holder.

And we need to do this reparenting. The style's dropdown holder specifies the area and the place of the dropdown, and the way it expands (i.e. size expansion or overlay).

Revision history for this message
Cris Dywan (kalikiana) wrote :

=== modified file 'src/imports/Components/1.3/ComboButton.qml'
--- src/imports/Components/1.3/ComboButton.qml 2016-09-13 15:01:14 +0000
+++ src/imports/Components/1.3/ComboButton.qml 2016-09-13 15:57:46 +0000
@@ -395,6 +395,7 @@
         }
     }
     Scrollbar {
+ parent: comboHolder.parent
         flickableItem: comboHolder
     }

This appears to work. However no test seems to catch this problem - we need to find a way to test that this is actually fixed.

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.