diff options
author | Mavridis Philippe <[email protected]> | 2024-05-25 15:05:26 +0300 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2024-05-25 15:05:26 +0300 |
commit | 9ed610f50d8f7e8278b12b442aa23956293837ab (patch) | |
tree | 9e9f69f491e5953ba93ab119326498c838c78776 /konqueror/konq_view.cpp | |
parent | 22db72d853c2ec99a2c9fd41cf73fc1f22008707 (diff) | |
download | tdebase-9ed610f50d8f7e8278b12b442aa23956293837ab.tar.gz tdebase-9ed610f50d8f7e8278b12b442aa23956293837ab.zip |
Konqueror: Add support for back/forward actions using history mouse buttons
This closes #421.
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'konqueror/konq_view.cpp')
-rw-r--r-- | konqueror/konq_view.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/konqueror/konq_view.cpp b/konqueror/konq_view.cpp index 0f809ccd1..c65537382 100644 --- a/konqueror/konq_view.cpp +++ b/konqueror/konq_view.cpp @@ -472,7 +472,7 @@ void KonqView::connectPart( ) m_pPart->widget()->installEventFilter( this ); - if (m_bBackRightClick && m_pPart->widget()->inherits("TQScrollView") ) + if (m_pPart->widget()->inherits("TQScrollView")) { (static_cast<TQScrollView *>(m_pPart->widget()))->viewport()->installEventFilter( this ); } @@ -1220,10 +1220,6 @@ void KonqView::reparseConfiguration() bool b = KonqSettings::backRightClick(); if ( m_bBackRightClick != b ) { - if (m_bBackRightClick && m_pPart->widget()->inherits("TQScrollView") ) - { - (static_cast<TQScrollView *>(m_pPart->widget()))->viewport()->installEventFilter( this ); - } enableBackRightClick( b ); } } @@ -1289,6 +1285,21 @@ bool KonqView::eventFilter( TQObject *obj, TQEvent *e ) emit ext->openURLRequest( lstDragURLs.first() ); // this will call m_pMainWindow::slotOpenURLRequest delayed } + else if (e->type() == TQEvent::MouseButtonRelease) + { + TQMouseEvent *mouseEvent = static_cast<TQMouseEvent*>(e); + switch (mouseEvent->button()) + { + case TQMouseEvent::HistoryBackButton: + go(-1); + return true; + + case TQMouseEvent::HistoryForwardButton: + go(1); + return true; + } + } + if ( m_bBackRightClick ) { if ( e->type() == TQEvent::ContextMenu ) |