]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinsearchbox.h
Apply 1 suggestion(s) to 1 file(s)
[dolphin.git] / src / search / dolphinsearchbox.h
index b73c2899ff9f1bdced71c4abaa1a8c4b164cce67..6a847ba57e0315fef7350529d5fcbfde616fa7a4 100644 (file)
@@ -7,8 +7,9 @@
 #ifndef DOLPHINSEARCHBOX_H
 #define DOLPHINSEARCHBOX_H
 
+#include "animatedheightwidget.h"
+
 #include <QUrl>
-#include <QWidget>
 
 class DolphinFacetsWidget;
 class DolphinQuery;
@@ -18,7 +19,6 @@ class QToolButton;
 class QScrollArea;
 class QLabel;
 class QVBoxLayout;
-class KMoreToolsMenuFactory;
 
 /**
  * @brief Input box for searching files with or without Baloo.
@@ -30,7 +30,7 @@ class KMoreToolsMenuFactory;
  * If Baloo is available and the current folder is indexed, further
  * options are offered.
  */
-class DolphinSearchBox : public QWidget
+class DolphinSearchBox : public AnimatedHeightWidget
 {
     Q_OBJECT
 
@@ -87,8 +87,13 @@ public:
      */
     bool isActive() const;
 
+    /*
+     * @see AnimatedHeightWidget::setVisible()
+     * @see QWidget::setVisible()
+     */
+    void setVisible(bool visible, Animated animated);
+
 protected:
-    bool event(QEvent *event) override;
     void showEvent(QShowEvent *event) override;
     void hideEvent(QHideEvent *event) override;
     void keyReleaseEvent(QKeyEvent *event) override;
@@ -153,6 +158,9 @@ private:
 
     bool isIndexingEnabled() const;
 
+    /** @see AnimatedHeightWidget::preferredHeight() */
+    int preferredHeight() const override;
+
 private:
     QString queryTitle(const QString &text) const;
 
@@ -172,9 +180,10 @@ private:
     DolphinFacetsWidget *m_facetsWidget;
 
     QUrl m_searchPath;
-    QScopedPointer<KMoreToolsMenuFactory> m_menuFactory;
 
     QTimer *m_startSearchTimer;
+
+    bool m_initialized;
 };
 
 #endif