mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
support plugin menu
Change-Id: I076151e169e0c4425a65aaa845717bae9ff3e442
This commit is contained in:
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
@ -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();
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user