mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
hide popup when mouse press
Change-Id: I057b43dd1698b775c79d71972519278da1d770ff
This commit is contained in:
parent
e3e3d768ad
commit
56654bd0b9
Notes:
Deepin Code Review
2016-08-09 03:05:53 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Tue, 09 Aug 2016 03:05:53 +0000 Reviewed-on: https://cr.deepin.io/15009 Project: dde/dde-dock Branch: refs/heads/master
@ -231,9 +231,6 @@ void AppItem::paintEvent(QPaintEvent *e)
|
|||||||
painter.drawPixmap(itemRect.center() - pixmap.rect().center(), ImageFactory::lighterEffect(pixmap));
|
painter.drawPixmap(itemRect.center() - pixmap.rect().center(), ImageFactory::lighterEffect(pixmap));
|
||||||
|
|
||||||
// Update the window icon geometry when the icon is changed.
|
// Update the window icon geometry when the icon is changed.
|
||||||
if (m_updateIconGeometryTimer->isActive()) {
|
|
||||||
m_updateIconGeometryTimer->stop();
|
|
||||||
}
|
|
||||||
m_updateIconGeometryTimer->start();
|
m_updateIconGeometryTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,6 +246,9 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
|
|
||||||
void AppItem::mousePressEvent(QMouseEvent *e)
|
void AppItem::mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
|
m_updateIconGeometryTimer->stop();
|
||||||
|
hidePopup();
|
||||||
|
|
||||||
if (e->button() == Qt::RightButton)
|
if (e->button() == Qt::RightButton)
|
||||||
{
|
{
|
||||||
if (perfectIconRect().contains(e->pos()))
|
if (perfectIconRect().contains(e->pos()))
|
||||||
|
@ -101,10 +101,7 @@ void DockItem::leaveEvent(QEvent *e)
|
|||||||
|
|
||||||
// auto hide if popup is not model window
|
// auto hide if popup is not model window
|
||||||
if (m_popupShown && !PopupWindow->model())
|
if (m_popupShown && !PopupWindow->model())
|
||||||
{
|
hidePopup();
|
||||||
m_popupShown = false;
|
|
||||||
PopupWindow->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@ -213,8 +210,7 @@ void DockItem::popupWindowAccept()
|
|||||||
|
|
||||||
disconnect(PopupWindow.get(), &DockPopupWindow::accept, this, &DockItem::popupWindowAccept);
|
disconnect(PopupWindow.get(), &DockPopupWindow::accept, this, &DockItem::popupWindowAccept);
|
||||||
|
|
||||||
m_popupShown = false;
|
hidePopup();
|
||||||
PopupWindow->hide();
|
|
||||||
|
|
||||||
emit requestWindowAutoHide(true);
|
emit requestWindowAutoHide(true);
|
||||||
}
|
}
|
||||||
@ -264,3 +260,9 @@ const QPoint DockItem::popupMarkPoint()
|
|||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DockItem::hidePopup()
|
||||||
|
{
|
||||||
|
m_popupShown = false;
|
||||||
|
PopupWindow->hide();
|
||||||
|
}
|
||||||
|
@ -49,6 +49,7 @@ protected:
|
|||||||
const QRect perfectIconRect() const;
|
const QRect perfectIconRect() const;
|
||||||
const QPoint popupMarkPoint();
|
const QPoint popupMarkPoint();
|
||||||
|
|
||||||
|
void hidePopup();
|
||||||
void showContextMenu();
|
void showContextMenu();
|
||||||
void showHoverTips();
|
void showHoverTips();
|
||||||
void popupWindowAccept();
|
void popupWindowAccept();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user