]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Move from the searchbox to the results with the down arrow key
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 18 Apr 2020 16:30:02 +0000 (10:30 -0600)
committerNate Graham <nate@kde.org>
Sat, 18 Apr 2020 16:37:01 +0000 (10:37 -0600)
Summary:
Move from the searchbox to the search results listbox/view using the
down arrow key in addition to the existing methods using the tab key,
return key, or the mouse.

Test Plan:
use ctrl+f to search in a directory tree, press down arrow key
to go to the results

Reviewers: ngraham, #dolphin

Reviewed By: ngraham, #dolphin

Subscribers: meven, elvisangelaccio, ngraham, iasensio, kfm-devel

Tags: #dolphin

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

src/dolphinviewcontainer.cpp
src/search/dolphinsearchbox.cpp
src/search/dolphinsearchbox.h

index 0681c67d9929ed41f2706a3fb644484b6316c0b5..60d3374ad46cce67469ab5844aba3bb642cdd402 100644 (file)
@@ -119,7 +119,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     connect(m_searchBox, &DolphinSearchBox::activated, this, &DolphinViewContainer::activate);
     connect(m_searchBox, &DolphinSearchBox::closeRequest, this, &DolphinViewContainer::closeSearchBox);
     connect(m_searchBox, &DolphinSearchBox::searchRequest, this, &DolphinViewContainer::startSearching);
-    connect(m_searchBox, &DolphinSearchBox::returnPressed, this, &DolphinViewContainer::requestFocus);
+    connect(m_searchBox, &DolphinSearchBox::focusViewRequest, this, &DolphinViewContainer::requestFocus);
     m_searchBox->setWhatsThis(xi18nc("@info:whatsthis findbar",
         "<para>This helps you find files and folders. Enter a <emphasis>"
         "search term</emphasis> and specify search settings with the "
index 23f520de148a3f1ba710cb652828bb2de5830f81..22941104cc95aff67dc8dda92efcdca5b735e9ba 100644 (file)
@@ -219,6 +219,9 @@ void DolphinSearchBox::keyReleaseEvent(QKeyEvent* event)
             m_searchInput->clear();
         }
     }
+    else if (event->key() == Qt::Key_Down) {
+        emit focusViewRequest();
+    }
 }
 
 bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event)
@@ -283,7 +286,7 @@ void DolphinSearchBox::slotSearchTextChanged(const QString& text)
 void DolphinSearchBox::slotReturnPressed()
 {
     emitSearchRequest();
-    emit returnPressed();
+    emit focusViewRequest();
 }
 
 void DolphinSearchBox::slotFacetChanged()
index 5fef4ec5a7bdd5464e27818b762ea1456b754d6c..2bf3ce4b18c0c700a7295b617e9694a394bea1c9 100644 (file)
@@ -118,8 +118,6 @@ signals:
      */
     void searchTextChanged(const QString& text);
 
-    void returnPressed();
-
     /**
      * Emitted as soon as the search box should get closed.
      */
@@ -131,6 +129,7 @@ signals:
      * @see DolphinSearchBox::setActive()
      */
     void activated();
+    void focusViewRequest();
 
 private slots:
     void emitSearchRequest();