From 342954bb1fdc59fde0a95f2ba97b7e7712cfb47d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 19 Dec 2010 12:03:46 +0000 Subject: Select the whole text in the filterbar and searchbox if the widget has lost the focus and gets focused again by the shortcut (this behavior is consistent to e.g. the behavior in Kate). CCBUG: 256160 svn path=/trunk/KDE/kdebase/apps/; revision=1207719 --- src/dolphinviewcontainer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 830dc5e74..508c0360d 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -239,6 +239,10 @@ bool DolphinViewContainer::isFilterBarVisible() const void DolphinViewContainer::setSearchModeEnabled(bool enabled) { if (enabled == isSearchModeEnabled()) { + if (enabled && !m_searchBox->hasFocus()) { + m_searchBox->setFocus(); + m_searchBox->selectAll(); + } return; } @@ -295,6 +299,7 @@ void DolphinViewContainer::setFilterBarVisible(bool visible) if (visible) { m_filterBar->show(); m_filterBar->setFocus(); + m_filterBar->selectAll(); } else { closeFilterBar(); } -- cgit v1.3