Let additional mouse buttons trigger history navigation

This is consistent with a recent change in Dolphin and with what browsers have been doing for a long time.

REVIEW: 105440
DIGEST:
remotes/origin/KDE/4.10
Sebastian Dörner 14 years ago
parent 2e2d9c4d66
commit 8ab7683ea1
  1. 2
      part.cpp
  2. 12
      ui/pageview.cpp
  3. 2
      ui/pageview.h

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

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

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

Loading…
Cancel
Save