From 0c0f8e1ef834c63aacd9054e1e89172551c20c46 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 8 Sep 2015 12:53:44 -0400 Subject: Fix up the "back" functionality for mouse4 clicks. --- lumina-fm/widgets/DDListWidgets.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lumina-fm/widgets/DDListWidgets.h') diff --git a/lumina-fm/widgets/DDListWidgets.h b/lumina-fm/widgets/DDListWidgets.h index c211206b..d47c7ee4 100644 --- a/lumina-fm/widgets/DDListWidgets.h +++ b/lumina-fm/widgets/DDListWidgets.h @@ -20,6 +20,7 @@ #include #include #include +#include //============== // LIST WIDGET @@ -84,11 +85,14 @@ protected: ev->setDropAction(Qt::CopyAction); } ev->accept(); //allow this to be dropped here - } + }else{ + ev->ignore(); + } } void dropEvent(QDropEvent *ev){ - if(this->whatsThis().isEmpty()){ return; } //not supported + if(this->whatsThis().isEmpty()){ ev->ignore(); return; } //not supported + //qDebug() << "Drop Event:"; ev->accept(); //handled here QString dirpath = this->whatsThis(); //See if the item under the drop point is a directory or not @@ -102,6 +106,11 @@ protected: //qDebug() << "Drop Event:" << dirpath; emit DataDropped( dirpath, QString(ev->mimeData()->data(MIME)).split("\n") ); } + + void mouseReleaseEvent(QMouseEvent *ev){ + if(ev->button() != Qt::RightButton && ev->button() != Qt::LeftButton){ ev->ignore(); } + else{ QListWidget::mouseReleaseEvent(ev); } //pass it along to the widget + } }; //================ @@ -185,5 +194,10 @@ protected: //qDebug() << "Drop Event:" << dirpath; emit DataDropped( dirpath, QString(ev->mimeData()->data(MIME)).split("\n") ); } + + void mouseReleaseEvent(QMouseEvent *ev){ + if(ev->button() != Qt::RightButton && ev->button() != Qt::LeftButton){ ev->ignore(); } + else{ QTreeWidget::mouseReleaseEvent(ev); } //pass it along to the widget + } }; #endif \ No newline at end of file -- cgit