updat popup behavior

Change-Id: I1d03d586dc83fb7b526cbb65f25ec1c60e5c989d
This commit is contained in:
石博文 2017-11-23 14:47:59 +08:00
parent a10715eb36
commit 9906af84ce
Notes: Deepin Code Review 2017-11-23 15:07:33 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Thu, 23 Nov 2017 15:07:33 +0800
Reviewed-on: https://cr.deepin.io/28810
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 10 additions and 7 deletions

View File

@ -117,6 +117,12 @@ void PluginsItem::mousePressEvent(QMouseEvent *e)
if (e->button() == Qt::LeftButton)
MousePressPoint = e->pos();
const QPoint dis = e->pos() - rect().center();
if (dis.manhattanLength() > std::min(width(), height()) / 2 * 0.8)
QWidget::mousePressEvent(e);
else
DockItem::mousePressEvent(e);
}
void PluginsItem::mouseMoveEvent(QMouseEvent *e)

View File

@ -112,19 +112,16 @@ void FashionTrayItem::paintEvent(QPaintEvent *e)
void FashionTrayItem::mousePressEvent(QMouseEvent *e)
{
const QPoint dis = e->pos() - rect().center();
if (dis.manhattanLength() > std::min(width(), height()) / 2 * 0.8)
return QWidget::mousePressEvent(e);
// if (e->button() != Qt::RightButton)
QWidget::mousePressEvent(e);
QWidget::mousePressEvent(e);
m_pressPoint = e->pos();
}
void FashionTrayItem::mouseReleaseEvent(QMouseEvent *e)
{
QWidget::mouseReleaseEvent(e);
const QPoint dis = e->pos() - rect().center();
if (dis.manhattanLength() > std::min(width(), height()) / 2 * 0.8)
return QWidget::mouseReleaseEvent(e);
const QPoint point = e->pos() - m_pressPoint;