From b706108206be1c9e777e1ace02aa99247fdfc3ca Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sun, 31 Jul 2016 19:16:18 +0200 Subject: Use tab for switching active split REVIEW: 128564 REVIEW: 110970 BUGS: 171743 --- src/views/dolphinview.cpp | 9 +++++++++ src/views/dolphinview.h | 5 +++++ 2 files changed, 14 insertions(+) (limited to 'src/views') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index a737dd0a6..4105628ee 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -724,6 +724,15 @@ void DolphinView::stopLoading() bool DolphinView::eventFilter(QObject* watched, QEvent* event) { switch (event->type()) { + case QEvent::KeyPress: + if (GeneralSettings::useTabForSwitchingSplitView()) { + QKeyEvent* keyEvent = static_cast(event); + if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) { + toggleActiveViewRequested(); + return true; + } + } + break; case QEvent::FocusIn: if (watched == m_container) { setActive(true); diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index d1a5d5005..0b0d8196d 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -546,6 +546,11 @@ signals: */ void goForwardRequested(); + /** + * Is emitted when the user wants to move the focus to another view. + */ + void toggleActiveViewRequested(); + protected: /** Changes the zoom level if Control is pressed during a wheel event. */ virtual void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE; -- cgit v1.3