From a409afab796df1f3154651d8d2e5c1557672a622 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 4 Mar 2009 15:47:59 +0000 Subject: [PATCH] better syncing between dialog graphicswidget and the dialog (popups shows up at a sane size now) svn path=/trunk/KDE/kdelibs/; revision=935167 --- dialog.cpp | 5 +---- popupapplet.cpp | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dialog.cpp b/dialog.cpp index 284728772..01a8479cc 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -442,10 +442,7 @@ void Dialog::showEvent(QShowEvent * event) //check if the widget size is still synced with the view if (d->widget && d->view && d->widget->size().toSize() != d->view->size()) { - d->widget->resize(d->view->size()); - - d->view->setSceneRect(d->widget->mapToScene(d->widget->boundingRect()).boundingRect()); - d->view->centerOn(d->widget); + d->adjustView(); } if (d->view) { diff --git a/popupapplet.cpp b/popupapplet.cpp index c403eeeea..1cf45648e 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -251,9 +251,6 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) q->resize(prefSize); emit q->appletTransformedItself(); } - - //FIXME: this will be automatically propagated by the qgraphicslayout in the future - lay->setPreferredSize(prefSize); //Applet on popup } else { kDebug() << "about to switch to a popup"; @@ -296,6 +293,7 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) if (corona) { corona->addOffscreenWidget(gWidget); dialog->setGraphicsWidget(gWidget); + gWidget->resize(gWidget->preferredSize()); } } else if (qWidget) { QVBoxLayout *l_layout = new QVBoxLayout(dialog);