ToolTip: Prevent multiple geometry changes while changing contents

Unset mainItem and set it back only after changing of tooltip contents
is completed. This improves behavior of morphingpopups effect (popups
animates from/to incorrect values).

REVIEW: 127118
This commit is contained in:
David Rosca 2016-02-21 15:06:44 +01:00
parent 4eeed04f0f
commit fca765bc05

View File

@ -132,9 +132,8 @@ void ToolTip::showToolTip()
setMainItem(dlg->loadDefaultItem());
}
if (dlg->mainItem()) {
dlg->mainItem()->setVisible(false);
}
// Unset the dialog's old contents before reparenting the dialog.
dlg->setMainItem(Q_NULLPTR);
Plasma::Types::Location location = m_location;
if (m_location == Plasma::Types::Floating) {
@ -154,12 +153,11 @@ void ToolTip::showToolTip()
}
dlg->setOwner(this);
dlg->show();
dlg->setLocation(location);
dlg->setMainItem(mainItem());
dlg->setVisualParent(this);
dlg->setMainItem(mainItem());
dlg->setInteractive(m_interactive);
dlg->show();
}
QString ToolTip::mainText() const