]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Hide tooltip instantly on filter change
authorPiotr Henryk Dabrowski <phd@phd.re>
Sat, 11 Jan 2020 15:09:36 +0000 (16:09 +0100)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 11 Jan 2020 15:13:08 +0000 (16:13 +0100)
Summary:
Instantly hide tooltip shown over an element when filter bar changes.

Currently the tooltip stays even when filtering causes the file under the mouse to change or disappears entirely.
The tooltip also continues to cover much of the window - hiding the new filtering results from user.

This is an enhancement to D22512

Test Plan:
1. place the mouse pointer over a file to show the tooltip
2. press "/" to activate filter bar
3. type in filter phrase

Reviewers: #dolphin, elvisangelaccio, ngraham

Subscribers: kfm-devel

Tags: #dolphin

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

src/dolphinviewcontainer.cpp
src/views/dolphinview.h

index a7587a91c8b1620dbaded324cfb86f8702f3d147..9ed7654fafaf9388e9a4e4cd368aa15044dbe0da 100644 (file)
@@ -510,6 +510,7 @@ void DolphinViewContainer::setFilterBarVisible(bool visible)
 {
     Q_ASSERT(m_filterBar);
     if (visible) {
+        m_view->hideToolTip(ToolTipManager::HideBehavior::Instantly);
         m_filterBar->show();
         m_filterBar->setFocus();
         m_filterBar->selectAll();
@@ -659,6 +660,7 @@ void DolphinViewContainer::closeFilterBar()
 
 void DolphinViewContainer::setNameFilter(const QString& nameFilter)
 {
+    m_view->hideToolTip(ToolTipManager::HideBehavior::Instantly);
     m_view->setNameFilter(nameFilter);
     delayedStatusBarUpdate();
 }
index ba38d323479a57c54c7b8f9fc31c674d3422e5e7..538e00e83ef5aebc47104b7d582d2b97ef23afb2 100644 (file)
@@ -312,6 +312,11 @@ public:
      */
     static QUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true);
 
+    /**
+     * Hides tooltip displayed over element.
+     */
+    void hideToolTip(const ToolTipManager::HideBehavior behavior = ToolTipManager::HideBehavior::Later);
+
 public slots:
     /**
      * Changes the directory to \a url. If the current directory is equal to
@@ -737,11 +742,6 @@ private:
      */
     void applyModeToView();
 
-    /**
-     * Hides tooltip displayed over element.
-     */
-    void hideToolTip(const ToolTipManager::HideBehavior behavior = ToolTipManager::HideBehavior::Later);
-
     /**
      * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
      * Pastes the clipboard data into the URL \a url.