try harder to make the selected wallpaper visible
ClosedPublic

Authored by mart on Feb 17 2017, 3:02 PM.

Details

Summary

qml gridview don't have an official way to ensure the
current index is visible when the view is first instantiated,
the only way we have is to do positionViewAtIndex when we know the
proper space has already been allocated (Component.onCompleted
is way too early) we used to do that on onCountChanged, but that
too seems to early sometimes, as the selected wallpaper
is visible only sometimes, attaching it to onContentHeightChanged
seems to be more reliable (for all branches)

Test Plan

proper wallpaper is visible every time the window opens

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart updated this revision to Diff 11450.Feb 17 2017, 3:02 PM
mart retitled this revision from to try harder to make the selected wallpaper visible.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 17 2017, 3:02 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein added a subscriber: hein.Feb 17 2017, 3:09 PM

I've used multiple techniques to do similar "do stuff when positioning is complete". One is using PropertyChange in populate transitions to change a prop when populate is done.

I think Qt 5.9 will actually have an onPositioningComplete (at least for Flow).

mart added a comment.Feb 20 2017, 11:49 AM
In D4648#87129, @hein wrote:

I've used multiple techniques to do similar "do stuff when positioning is complete". One is using PropertyChange in populate transitions to change a prop when populate is done.

I think Qt 5.9 will actually have an onPositioningComplete (at least for Flow).

seems is only for positioners tough, not views (in which i guess it would be harder as the model can start to move things around at any moment)

davidedmundson accepted this revision.Feb 23 2017, 2:12 PM
This revision is now accepted and ready to land.Feb 23 2017, 2:12 PM
This revision was automatically updated to reflect the committed changes.