diff --git a/part.cpp b/part.cpp index 83558c35e..ce1db4d6f 100644 --- a/part.cpp +++ b/part.cpp @@ -2561,9 +2561,11 @@ void Part::unsetDummyMode() // add back and next in history m_historyBack = KStandardAction::documentBack( this, SLOT(slotHistoryBack()), actionCollection() ); m_historyBack->setWhatsThis( i18n( "Go to the place you were before" ) ); + connect(m_pageView, SIGNAL(mouseBackButtonClick()), m_historyBack, SLOT(trigger())); m_historyNext = KStandardAction::documentForward( this, SLOT(slotHistoryNext()), actionCollection()); m_historyNext->setWhatsThis( i18n( "Go to the place you were after" ) ); + connect(m_pageView, SIGNAL(mouseForwardButtonClick()), m_historyNext, SLOT(trigger())); m_pageView->setupActions( actionCollection() ); diff --git a/ui/pageview.cpp b/ui/pageview.cpp index ec29bf0e6..34baf7058 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -1949,6 +1949,18 @@ void PageView::mousePressEvent( QMouseEvent * e ) return; } + // trigger history navigation for additional mouse buttons + if ( e->button() == Qt::XButton1 ) + { + emit mouseBackButtonClick(); + return; + } + if ( e->button() == Qt::XButton2 ) + { + emit mouseForwardButtonClick(); + return; + } + // update press / 'start drag' mouse position d->mousePressPos = e->globalPos(); diff --git a/ui/pageview.h b/ui/pageview.h index bd9bdd967..7fe597983 100644 --- a/ui/pageview.h +++ b/ui/pageview.h @@ -131,6 +131,8 @@ Q_OBJECT signals: void urlDropped( const KUrl& ); void rightClick( const Okular::Page *, const QPoint & ); + void mouseBackButtonClick(); + void mouseForwardButtonClick(); protected: void resizeEvent( QResizeEvent* );