diff --git a/app/mainwindow.h b/app/mainwindow.h --- a/app/mainwindow.h +++ b/app/mainwindow.h @@ -30,6 +30,8 @@ class QUrl; +class QMouseEvent; + namespace Gwenview { @@ -79,6 +81,7 @@ void saveProperties(KConfigGroup&) Q_DECL_OVERRIDE; void readProperties(const KConfigGroup&) Q_DECL_OVERRIDE; bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; private Q_SLOTS: void setActiveViewModeAction(QAction* action); diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef Q_OS_OSX #include #endif @@ -1654,6 +1655,23 @@ return false; } +void MainWindow::mousePressEvent(QMouseEvent *event) +{ + switch(event->button()) { + case Qt::ForwardButton: + if (d->mGoToNextAction->isEnabled()) { + d->mGoToNextAction->trigger(); + } + break; + case Qt::BackButton: + if (d->mGoToPreviousAction->isEnabled()) { + d->mGoToPreviousAction->trigger(); + } + break; + } + KXmlGuiWindow::mousePressEvent(event); +} + void MainWindow::setDistractionFreeMode(bool value) { d->mFullScreenContent->setDistractionFreeMode(value);