minimize x move/resize calls

ensure starting and ending point of the animation are correct
BUG:335789
This commit is contained in:
Marco Martin 2014-06-05 12:08:03 +02:00
parent a06c1569a1
commit 61dadaa558

View File

@ -115,19 +115,22 @@ bool ToolTipDialog::event(QEvent *e)
void ToolTipDialog::adjustGeometry(const QRect &geom)
{
if (isVisible()) {
QRect startGeom(geometry());
switch (location()) {
case Plasma::Types::RightEdge:
setX(x() + (size().width() - geom.size().width()));
startGeom.moveLeft(geom.left());
break;
case Plasma::Types::BottomEdge:
setY(y() + (size().height() - geom.size().height()));
startGeom.moveTop(geom.top());
break;
default:
break;
}
resize(geom.size());
m_animation->setStartValue(position());
startGeom.setSize(geom.size());
m_animation->setStartValue(startGeom.topLeft());
m_animation->setEndValue(geom.topLeft());
m_animation->start();
} else {