From 67695c1b01ea241b359e456dad44488e5cd9fdce Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Mon, 28 Oct 2024 03:58:45 +0100 Subject: Make Escape move focus from location bar to view Pressing Escape on the location bar while in breadcrumb mode has no effect at all. This commit changes this to instead move the focus to the active view. This is more logical because a user pressing escape while having focus on the location bar is no longer interested in interacting and changing the location in the location bar. They most likely want to act on the current location instead. --- src/dolphinurlnavigator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/dolphinurlnavigator.cpp') diff --git a/src/dolphinurlnavigator.cpp b/src/dolphinurlnavigator.cpp index 3a40eea5c..5c32538b0 100644 --- a/src/dolphinurlnavigator.cpp +++ b/src/dolphinurlnavigator.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -145,4 +146,13 @@ void DolphinUrlNavigator::slotReturnPressed() } } +void DolphinUrlNavigator::keyPressEvent(QKeyEvent *keyEvent) +{ + if (keyEvent->key() == Qt::Key_Escape && !isUrlEditable()) { + Q_EMIT requestToLoseFocus(); + return; + } + KUrlNavigator::keyPressEvent(keyEvent); +} + #include "moc_dolphinurlnavigator.cpp" -- cgit v1.3