mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix left mouse button not work
Change-Id: I9802b0e8fce0d1bed81d950fe40d66110b864250
This commit is contained in:
parent
338f159999
commit
52d180ea88
Notes:
Deepin Code Review
2016-08-16 02:59:43 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Tue, 16 Aug 2016 02:59:43 +0000 Reviewed-on: https://cr.deepin.io/15237 Project: dde/dde-dock Branch: refs/heads/master
@ -78,6 +78,9 @@ void DatetimeWidget::paintEvent(QPaintEvent *e)
|
||||
|
||||
void DatetimeWidget::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->button() != Qt::RightButton)
|
||||
return QWidget::mousePressEvent(e);
|
||||
|
||||
const QPoint p(e->pos() - rect().center());
|
||||
if (p.manhattanLength() < std::min(width(), height()) * 0.8 * 0.5)
|
||||
return;
|
||||
|
@ -35,6 +35,9 @@ void DiskPluginItem::resizeEvent(QResizeEvent *e)
|
||||
|
||||
void DiskPluginItem::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->button() != Qt::RightButton)
|
||||
return QWidget::mousePressEvent(e);
|
||||
|
||||
const QPoint p(e->pos() - rect().center());
|
||||
if (p.manhattanLength() < std::min(width(), height()) * 0.8 * 0.5)
|
||||
return;
|
||||
|
@ -76,7 +76,7 @@ void WiredItem::resizeEvent(QResizeEvent *e)
|
||||
|
||||
void WiredItem::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->button() == Qt::LeftButton)
|
||||
if (e->button() != Qt::RightButton)
|
||||
return QWidget::mousePressEvent(e);
|
||||
|
||||
const QPoint p(e->pos() - rect().center());
|
||||
|
@ -54,7 +54,7 @@ void WirelessItem::resizeEvent(QResizeEvent *e)
|
||||
|
||||
void WirelessItem::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->button() == Qt::LeftButton)
|
||||
if (e->button() != Qt::RightButton)
|
||||
return QWidget::mousePressEvent(e);
|
||||
|
||||
const QPoint p(e->pos() - rect().center());
|
||||
|
@ -75,7 +75,7 @@ void PluginWidget::paintEvent(QPaintEvent *e)
|
||||
|
||||
void PluginWidget::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->button() == Qt::LeftButton)
|
||||
if (e->button() != Qt::RightButton)
|
||||
return QWidget::mousePressEvent(e);
|
||||
|
||||
const QPoint p(e->pos() - rect().center());
|
||||
|
@ -37,7 +37,7 @@ void SoundItem::resizeEvent(QResizeEvent *e)
|
||||
|
||||
void SoundItem::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->button() == Qt::LeftButton)
|
||||
if (e->button() != Qt::RightButton)
|
||||
return QWidget::mousePressEvent(e);
|
||||
|
||||
const QPoint p(e->pos() - rect().center());
|
||||
|
Loading…
x
Reference in New Issue
Block a user