fix popup menu at efficient mode

Change-Id: Ic1f80eaa718915d9b7112e826a111648fe198cba
This commit is contained in:
石博文 2016-08-04 16:54:10 +08:00
parent 42831a2c94
commit 5d7e6c8866
Notes: Deepin Code Review 2016-08-04 09:08:24 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Thu, 04 Aug 2016 09:08:23 +0000
Reviewed-on: https://cr.deepin.io/14918
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -74,7 +74,9 @@ void TrayWidget::paintEvent(QPaintEvent *e)
void TrayWidget::mousePressEvent(QMouseEvent *e)
{
QWidget::mousePressEvent(e);
const QPoint point(e->pos() - rect().center());
if (point.manhattanLength() > 24)
return QWidget::mousePressEvent(e);
m_pressPoint = e->pos();
}
@ -83,6 +85,10 @@ void TrayWidget::mouseReleaseEvent(QMouseEvent *e)
{
QWidget::mouseReleaseEvent(e);
const QPoint point(e->pos() - rect().center());
if (point.manhattanLength() > 24)
return;
const QPoint distance = e->pos() - m_pressPoint;
if (distance.manhattanLength() > DRAG_THRESHOLD)
return;