appitem: fix popup tips position error when item adjust

Change-Id: I1dae66ee07451731596181feb14ca56ddac69686
This commit is contained in:
石博文 2017-06-16 10:50:16 +08:00
parent 3428c67280
commit 47be1507da
Notes: Deepin Code Review 2017-06-16 10:54:58 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Fri, 16 Jun 2017 10:54:54 +0800
Reviewed-on: https://cr.deepin.io/23873
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 9 additions and 1 deletions

View File

@ -16,6 +16,7 @@ DockItem::DockItem(QWidget *parent)
m_popupShown(false),
m_popupTipsDelayTimer(new QTimer(this)),
m_popupAdjustDelayTimer(new QTimer(this)),
m_menuManagerInter(new DBusMenuManager(this))
{
@ -36,7 +37,11 @@ DockItem::DockItem(QWidget *parent)
m_popupTipsDelayTimer->setInterval(500);
m_popupTipsDelayTimer->setSingleShot(true);
m_popupAdjustDelayTimer->setInterval(100);
m_popupAdjustDelayTimer->setSingleShot(true);
connect(m_popupTipsDelayTimer, &QTimer::timeout, this, &DockItem::showHoverTips);
connect(m_popupAdjustDelayTimer, &QTimer::timeout, this, &DockItem::updatePopupPosition);
}
DockItem::~DockItem()
@ -57,6 +62,8 @@ void DockItem::setDockDisplayMode(const DisplayMode mode)
void DockItem::updatePopupPosition()
{
Q_ASSERT(sender() == m_popupAdjustDelayTimer);
if (!m_popupShown || !PopupWindow->isVisible())
return;
@ -73,7 +80,7 @@ void DockItem::moveEvent(QMoveEvent *e)
{
QWidget::moveEvent(e);
updatePopupPosition();
m_popupAdjustDelayTimer->start();
}
//void DockItem::mouseMoveEvent(QMouseEvent *e)

View File

@ -73,6 +73,7 @@ protected:
bool m_popupShown;
QTimer *m_popupTipsDelayTimer;
QTimer *m_popupAdjustDelayTimer;
DBusMenuManager *m_menuManagerInter;