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.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dolphinurlnavigator.h') diff --git a/src/dolphinurlnavigator.h b/src/dolphinurlnavigator.h index 1387b567f..d6da51b47 100644 --- a/src/dolphinurlnavigator.h +++ b/src/dolphinurlnavigator.h @@ -92,6 +92,18 @@ public Q_SLOTS: * preferred in the Dolphin settings. */ void slotReturnPressed(); + +Q_SIGNALS: + /** + * Escape was pressed, and the focus should return to the view. + */ + void requestToLoseFocus(); + +protected: + /** + * Return focus back to the view when pressing Escape and this would have no other effect (e.g. deselecting or changing edit mode). + */ + void keyPressEvent(QKeyEvent *keyEvent) override; }; #endif // DOLPHINURLNAVIGATOR_H -- cgit v1.3