fix left mouse button not work

Change-Id: I9802b0e8fce0d1bed81d950fe40d66110b864250
This commit is contained in:
石博文 2016-08-16 10:55:59 +08:00
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
6 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());