minimize x move/resize calls
ensure starting and ending point of the animation are correct BUG:335789
This commit is contained in:
parent
a06c1569a1
commit
61dadaa558
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user