move the dialog in relation to the delta of the size change when the applet localtion is bottom or right, instead of calling popupposition each time

svn path=/trunk/KDE/kdelibs/; revision=1111730
This commit is contained in:
Marco Martin 2010-04-06 15:04:33 +00:00
parent 3660bcf30d
commit 2cecd31fe2

View File

@ -567,10 +567,16 @@ void Dialog::resizeEvent(QResizeEvent *event)
}
Plasma::Applet *applet = d->applet();
if (applet) {
if (applet && !event->oldSize().isEmpty()) {
Plasma::Corona *corona = qobject_cast<Plasma::Corona *>(applet->scene());
if (corona) {
move(corona->popupPosition(applet, size()));
QSize deltaSize(event->size() - event->oldSize());
if (applet->location() == Plasma::BottomEdge) {
move(pos() - QPoint(0, deltaSize.height()));
} else if (applet->location() == Plasma::RightEdge) {
move(pos() - QPoint(deltaSize.width(), 0));
}
}
}
}