From 94ef8919bf196c134706d2ed71f9fadaec68838b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 16 Dec 2008 18:37:02 +0000 Subject: [PATCH] Assure that the view gets focused when: * Enter or Ctrl+Enter is pressed in the URL navigator * when the filter bar gets closed BUG: 158232 svn path=/trunk/KDE/kdebase/apps/; revision=897739 --- src/dolphinview.cpp | 2 ++ src/dolphinviewcontainer.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 969da773dc..b1c0bf7437 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -1253,6 +1253,7 @@ void DolphinView::createView() Q_ASSERT(view != 0); view->installEventFilter(this); view->viewport()->installEventFilter(this); + setFocusProxy(view); if (m_mode != ColumnView) { // Give the view the ability to auto-expand its directories on hovering @@ -1315,6 +1316,7 @@ void DolphinView::deleteView() // before deleting the view: Otherwise when having a split // view the other view will get the focus and will request // an activation (see DolphinView::eventFilter()). + setFocusProxy(0); setFocus(); m_topLayout->removeWidget(view); diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 794418eabe..a70055b5ff 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -261,6 +261,10 @@ void DolphinViewContainer::slotDirListerCompleted() KonqFileItemCapabilities capabilities(KFileItemList() << item); createNew->setEnabled(capabilities.supportsWriting()); } + + if (isActive()) { + m_view->setFocus(); + } } void DolphinViewContainer::showItemInfo(const KFileItem& item) @@ -291,6 +295,7 @@ void DolphinViewContainer::closeFilterBar() { m_filterBar->hide(); m_filterBar->clear(); + m_view->setFocus(); emit showFilterBarChanged(false); }