Diffusion KIO 33442c012eb2

[kfilewidget] Return editable URL navigator to breadcrumb mode if it has focus…

Authored by ngraham on Dec 16 2018, 8:45 PM.

Description

[kfilewidget] Return editable URL navigator to breadcrumb mode if it has focus and everything is selected and when Ctrl+L is pressed

Summary:
Currently, Ctrl++ toggles the location bar between editable and breadcrumb modes, which is nice. However, it does this even when the URL bar is not focused, which can lead to times when you want to enter a path and instead accidentally make it un-editable, oops.

This patch refines the behavior so that it only toggles the mode when the location bar has focus and everything is selected. This brings the behavior into 100% consistency with Dolphin, once D16980 lands.

Test Plan:

  • Compile and deploy
  • Open a file open/save dialog and make the location bar be breadcrumbs
  • Hit Ctrl+L twice in a row -> location field turns to being in breadcrumb mode. Focus is correctly returned to the main view.
  • Hit Ctrl+L, move focus elsewhere, then hit Ctrl+L again -> Location bar is editable and focused with everything selected.
  • Hit Ctrl+L, deselect some of the text, then hit Ctrl+L again -> Location bar selects everything.

Reviewers: Frameworks, Dolphin

Subscribers: kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D16981