mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
Merge "fix popup menu at efficient mode"
This commit is contained in:
commit
146219b2a2
@ -74,7 +74,9 @@ void TrayWidget::paintEvent(QPaintEvent *e)
|
|||||||
|
|
||||||
void TrayWidget::mousePressEvent(QMouseEvent *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();
|
m_pressPoint = e->pos();
|
||||||
}
|
}
|
||||||
@ -83,6 +85,10 @@ void TrayWidget::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
{
|
{
|
||||||
QWidget::mouseReleaseEvent(e);
|
QWidget::mouseReleaseEvent(e);
|
||||||
|
|
||||||
|
const QPoint point(e->pos() - rect().center());
|
||||||
|
if (point.manhattanLength() > 24)
|
||||||
|
return;
|
||||||
|
|
||||||
const QPoint distance = e->pos() - m_pressPoint;
|
const QPoint distance = e->pos() - m_pressPoint;
|
||||||
if (distance.manhattanLength() > DRAG_THRESHOLD)
|
if (distance.manhattanLength() > DRAG_THRESHOLD)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user