resize the view just after setting the containment

when the view is in SizeRootObjectToView mode, the root
object is resized in the event handler, that is too late at startup.
resize the root object right after having announced
the new containment, so the view subclass can have
the view resized to the proper size beforehand,
removing an useless containment graphicsobject resize.

REVIEW:128915
This commit is contained in:
Marco Martin 2016-09-15 13:04:20 +02:00
parent 6837a1c855
commit 8f10b73cc1

View File

@ -95,6 +95,12 @@ void ContainmentViewPrivate::setContainment(Plasma::Containment *cont)
emit q->containmentChanged();
//we are QuickViewSharedEngine::SizeRootObjectToView, but that's not enough, as
//the root object isn't immediately resized (done at the resizeEvent handler).
//by resising it just before restoring the containment, it removes a chain of resizes at startup
if (q->rootObject()) {
q->rootObject()->setSize(q->size());
}
if (cont) {
cont->reactToScreenChange();
QObject::connect(cont, &Plasma::Containment::locationChanged,