move the view at the correct index at startup
ClosedPublic

Authored by mart on Feb 21 2017, 12:02 PM.

Details

Summary

using the same trick as elsewhere, set the currentIndex
and move the view to currentIndex right at startup
the only way to be sure is onContentHeightChanged
as there are no signals for when "the view has been
populated and settled up"

Test Plan

the view is at the right state since the first frame shown,
no more jumping around effect

Diff Detail

Repository
R108 KWin
Branch
phab/selectIndex
Lint
No Linters Available
Unit
No Unit Test Coverage
mart created this revision.Feb 21 2017, 12:02 PM
Restricted Application added a project: KWin. · View Herald TranscriptFeb 21 2017, 12:02 PM
Restricted Application added subscribers: KWin, kwin, plasma-devel. · View Herald Transcript
davidedmundson requested changes to this revision.Feb 21 2017, 12:13 PM
davidedmundson added a subscriber: davidedmundson.

The QML hack is fine, but it seems like you've written the C++ part without reading any of the existing code.

kcmkwin/kwindecoration/kcm.cpp
317–318

We're doing the exact same logic here. Duplicating it without deleting this is definitely wrong.

It looks like this should work as we've loaded the model and the model is populated at startup.
However if it's not, just add a new int property on the listView.

Or at an absolute minimum delete this.

This revision now requires changes to proceed.Feb 21 2017, 12:13 PM
mart updated this revision to Diff 11590.Feb 21 2017, 3:30 PM
mart edited edge metadata.

remove duplicate code

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptFeb 21 2017, 3:30 PM
mart added inline comments.Feb 21 2017, 3:33 PM
kcmkwin/kwindecoration/kcm.cpp
317–318

can be safely deleted.
it was working because was selecting the same index, makigng this effectively a noop

davidedmundson requested changes to this revision.Feb 23 2017, 2:12 PM
davidedmundson added inline comments.
kcmkwin/kwindecoration/kcm.cpp
102

We can't do this.

You've just restored the crash when hitting back.
See 70d2fb2378d636ef6d052da08417b27c99182fb0

This revision now requires changes to proceed.Feb 23 2017, 2:12 PM
mart added inline comments.Feb 23 2017, 2:33 PM
kcmkwin/kwindecoration/kcm.cpp
102

aww, right, this one is a qwidget,
will move it into the model code

mart updated this revision to Diff 11700.Feb 23 2017, 3:43 PM
mart edited edge metadata.
  • don't export the qwidget on the qml context
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptFeb 23 2017, 3:43 PM
davidedmundson accepted this revision.Feb 24 2017, 2:46 PM
This revision is now accepted and ready to land.Feb 24 2017, 2:46 PM
This revision was automatically updated to reflect the committed changes.