┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabwidget.cpp
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2019-01-29 06:31:46 -0700
committerNate Graham <[email protected]>2019-01-29 06:33:27 -0700
commitb7ceb51b44da394089689a2649cc8529c1f74669 (patch)
tree4b1ff0b0987f3634e8a411f53b21ad9740b6639a /src/dolphintabwidget.cpp
parent8bc93b564c283a677e02dc2ac71b40b63a990e38 (diff)
After opening and switching to a new tab, always focus the view
Summary: When Dolphin opens a new tab and immediately switches to it, the URL navigator gets focus if it's editable. If it's not, the breadcrumbs bar gets keyboard focus, which is not very useful since it's not really intended for keyboard navigation. This patch changes that behavior so that the view always gets focus, which seems more useful and more consistent. BUG: 401899 FIXED-IN: 19.04.0 Test Plan: 1. Put the URL navigator into breadcrumbs mode 2. Open a new tab 3. Observe that the view gets keyboard focus 4. Put the URL navigator into editable mode 5. Open a new tab 6. Observe that the view still gets keyboard focus Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: emateli, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D17635
Diffstat (limited to 'src/dolphintabwidget.cpp')
-rw-r--r--src/dolphintabwidget.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp
index 0cbe4529d..c708c6494 100644
--- a/src/dolphintabwidget.cpp
+++ b/src/dolphintabwidget.cpp
@@ -135,14 +135,10 @@ void DolphinTabWidget::openNewActivatedTab()
// The URL navigator of the new tab should have the same editable state
// as the current tab
- KUrlNavigator* navigator = newActiveViewContainer->urlNavigator();
- navigator->setUrlEditable(isUrlEditable);
+ newActiveViewContainer->urlNavigator()->setUrlEditable(isUrlEditable);
- if (isUrlEditable) {
- // If a new tab is opened and the URL is editable, assure that
- // the user can edit the URL without manually setting the focus
- navigator->setFocus();
- }
+ // Always focus the new tab's view
+ newActiveViewContainer->view()->setFocus();
}
void DolphinTabWidget::openNewActivatedTab(const QUrl& primaryUrl, const QUrl& secondaryUrl)