diff options
| author | Felix Ernst <[email protected]> | 2023-06-23 19:07:10 +0200 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2023-06-28 16:35:56 +0000 |
| commit | 0bf439833c489b6eb0e629271010b59ba90b8fa6 (patch) | |
| tree | c616cb1e16e2adaa0cd4f6d182f2ed749f7a5221 /src | |
| parent | ea56e1f75eae435c18e3934c402c94ae76ec9c11 (diff) | |
Move focus from hiding selection mode bars to view
When a user exits selection mode for example by clicking the "Exit
Selection Mode" button, the bar is closed but the focus doesn't return
to the view which would be expected. This commit actively moves the
focus to the view in such a scenario.
BUG: 469621
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 8627891c0..5a4540786 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -37,6 +37,7 @@ #include <KProtocolManager> #include <KShell> +#include <QApplication> #include <QDesktopServices> #include <QDropEvent> #include <QGridLayout> @@ -343,6 +344,9 @@ void DolphinViewContainer::setSelectionModeEnabled(bool enabled, KActionCollecti } Q_CHECK_PTR(m_selectionModeTopBar); // there is no point in disabling selectionMode when it wasn't even enabled once. Q_CHECK_PTR(m_selectionModeBottomBar); + if (m_selectionModeTopBar->isAncestorOf(QApplication::focusWidget()) || m_selectionModeBottomBar->isAncestorOf(QApplication::focusWidget())) { + m_view->setFocus(); + } m_selectionModeTopBar->setVisible(false, WithAnimation); m_selectionModeBottomBar->setVisible(false, WithAnimation); Q_EMIT selectionModeChanged(false); |
