← Back to team overview

ubuntu-phone team mailing list archive

Positioning the screen to an element in Expandable

 

I would like to position the screen so that it scrolls to a specific
element after opening a page.

First, I'd like to be able to make sure an Expandable is in view upon
expanding it (though this could be considered a bug of ExpandablesColumn
that it doesn't do this automatically).

But, then I'd also like to be able to bring certain sub-items to the top
of the display.

Unfortunately, reading the .y attribute always gives 0 for all these
elements. Likewise, trying to get the global position with something
like:
        root.mapFromItem(elem.parent, elem.x, elem.y).y
always returns 76.

I don't know if maybe the elements haven't finished loading or
something. If that is the case, is there any way to connect to the
elements positions when they are changed? I've tried things like
elem.onYChanged = function() ... but it's not working.

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups