Merge "fix popup menu at efficient mode"

This commit is contained in:
石博文 2016-08-04 09:08:23 +00:00 committed by Deepin Code Review
commit 146219b2a2

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;