diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -157,6 +157,7 @@ // Initialize the main view m_view = new DolphinView(url, this); + m_searchBox->setView(m_view); connect(m_view, &DolphinView::urlChanged, m_filterBar, &FilterBar::slotUrlChanged); connect(m_view, &DolphinView::urlChanged, diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -27,6 +27,7 @@ class DolphinQuery; class QLineEdit; class KSeparator; +class DolphinView; class QToolButton; class QScrollArea; class QLabel; @@ -99,6 +100,8 @@ */ bool isActive() const; + void setView(DolphinView * v); + protected: bool event(QEvent* event) override; void showEvent(QShowEvent* event) override; @@ -176,6 +179,7 @@ QToolButton* m_fromHereButton; QToolButton* m_everywhereButton; DolphinFacetsWidget* m_facetsWidget; + DolphinView* m_view; QUrl m_searchPath; QScopedPointer m_menuFactory; diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -23,6 +23,7 @@ #include "dolphin_searchsettings.h" #include "dolphinfacetswidget.h" #include "dolphinquery.h" +#include "views/dolphinview.h" #include "panels/places/placesitemmodel.h" #include @@ -219,6 +220,15 @@ m_searchInput->clear(); } } + else if (event->key() == Qt::Key_Down) { + Q_ASSERT(m_view); + m_view->setFocus(); + } +} + +void DolphinSearchBox::setView(DolphinView * v) +{ + m_view = v; } bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event)