diff options
author | Ken Moore <moorekou@gmail.com> | 2015-09-08 12:53:44 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-09-08 12:53:44 -0400 |
commit | 0c0f8e1ef834c63aacd9054e1e89172551c20c46 (patch) | |
tree | 1ba67cb3f2a939dd3c34bbacd32e0f597c98469e | |
parent | Quick fix to the libLumina project file to ensure all the colors/themes get i... (diff) | |
download | lumina-0c0f8e1ef834c63aacd9054e1e89172551c20c46.tar.gz lumina-0c0f8e1ef834c63aacd9054e1e89172551c20c46.tar.bz2 lumina-0c0f8e1ef834c63aacd9054e1e89172551c20c46.zip |
Fix up the "back" functionality for mouse4 clicks.
-rw-r--r-- | lumina-fm/widgets/DDListWidgets.h | 18 | ||||
-rw-r--r-- | lumina-fm/widgets/DirWidget.cpp | 4 |
2 files changed, 19 insertions, 3 deletions
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 <QDrag> #include <QFileInfo> #include <QDebug> +#include <QMouseEvent> //============== // 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 diff --git a/lumina-fm/widgets/DirWidget.cpp b/lumina-fm/widgets/DirWidget.cpp index 651ceb75..dd41f299 100644 --- a/lumina-fm/widgets/DirWidget.cpp +++ b/lumina-fm/widgets/DirWidget.cpp @@ -856,7 +856,9 @@ void DirWidget::startSync(){ // PROTECTED //==================== void DirWidget::mouseReleaseEvent(QMouseEvent *ev){ - if(ev->button()==Qt::BackButton){ + static Qt::MouseButtons backmap = Qt::BackButton | Qt::ExtraButton5; + //qDebug() << "Mouse Click:" << ev->button(); + if(backmap.testFlag(ev->button())){ ev->accept(); on_actionBack_triggered(); //}else if(ev->button()==Qt::ForwardButton()){ |