From 61dadaa558270627a40a64ce33fe7bf7d8e0e8d7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 5 Jun 2014 12:08:03 +0200 Subject: [PATCH] minimize x move/resize calls ensure starting and ending point of the animation are correct BUG:335789 --- src/declarativeimports/core/tooltipdialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/declarativeimports/core/tooltipdialog.cpp b/src/declarativeimports/core/tooltipdialog.cpp index a70b92eac..a522aaa0c 100644 --- a/src/declarativeimports/core/tooltipdialog.cpp +++ b/src/declarativeimports/core/tooltipdialog.cpp @@ -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; } + + startGeom.setSize(geom.size()); - resize(geom.size()); - m_animation->setStartValue(position()); + m_animation->setStartValue(startGeom.topLeft()); m_animation->setEndValue(geom.topLeft()); m_animation->start(); } else {