support plugin menu

Change-Id: I076151e169e0c4425a65aaa845717bae9ff3e442
This commit is contained in:
石博文 2016-08-03 09:16:04 +08:00
parent 05b2fc9c8b
commit dc88259043
Notes: Deepin Code Review 2016-08-03 01:20:06 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Wed, 03 Aug 2016 01:20:05 +0000
Reviewed-on: https://cr.deepin.io/14871
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 4 additions and 7 deletions

View File

@ -53,7 +53,7 @@ void PluginsItem::detachPluginWidget()
void PluginsItem::mousePressEvent(QMouseEvent *e)
{
DockItem::mousePressEvent(e);
QWidget::mousePressEvent(e);
if (e->button() == Qt::LeftButton)
MousePressPoint = e->pos();

View File

@ -68,23 +68,20 @@ void FashionTrayItem::paintEvent(QPaintEvent *e)
void FashionTrayItem::mousePressEvent(QMouseEvent *e)
{
QWidget::mousePressEvent(e);
const QPoint dis = e->pos() - rect().center();
if (dis.manhattanLength() > std::min(width(), height()) / 2 * 0.8)
return QWidget::mousePressEvent(e);
m_pressPoint = e->pos();
}
void FashionTrayItem::mouseReleaseEvent(QMouseEvent *e)
{
QWidget::mouseReleaseEvent(e);
const QPoint point = e->pos() - m_pressPoint;
if (point.manhattanLength() > DRAG_THRESHOLD)
return;
// if (e->button() == Qt::LeftButton)
// emit requestPopupApplet();
if (!m_activeTray)
return;