]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/filterbar/filterbar.h
SVN_SILENT made messages (.desktop file) - always resolve ours
[dolphin.git] / src / filterbar / filterbar.h
index 74c8457fcff7a9aa279c5652a4284d03ada29b0b..1424f4cb81211d7c461d954c063767f254b4db5d 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef FILTERBAR_H
 #define FILTERBAR_H
 
-#include <QWidget>
+#include "animatedheightwidget.h"
 
 class QLineEdit;
 class QToolButton;
@@ -19,12 +19,12 @@ class QToolButton;
  *
  * @author Gregor Kališnik <gregor@podnapisi.net>
  */
-class FilterBar : public QWidget
+class FilterBar : public AnimatedHeightWidget
 {
     Q_OBJECT
 
 public:
-    explicit FilterBar(QWidgetparent = nullptr);
+    explicit FilterBar(QWidget *parent = nullptr);
     ~FilterBar() override;
 
     /** Called by view container to hide this **/
@@ -35,20 +35,20 @@ public:
      */
     void selectAll();
 
-public slots:
+public Q_SLOTS:
     /** Clears the input field. */
     void clear();
     /** Clears the input field if the "lock button" is disabled. */
-    void slotUrlChanged();
+    void clearIfUnlocked();
     /** The input field is cleared also if the "lock button" is released. */
     void slotToggleLockButton(bool checked);
 
-signals:
+Q_SIGNALS:
     /**
      * Signal that reports the name filter has been
      * changed to \a nameFilter.
      */
-    void filterChanged(const QStringnameFilter);
+    void filterChanged(const QString &nameFilter);
 
     /**
      * Emitted as soon as the filterbar should get closed.
@@ -61,12 +61,15 @@ signals:
     void focusViewRequest();
 
 protected:
-    void showEvent(QShowEvent* event) override;
-    void keyReleaseEvent(QKeyEvent* event) override;
+    void showEvent(QShowEvent *event) override;
+    void keyPressEvent(QKeyEvent *event) override;
+
+    /** @see AnimatedHeightWidget::preferredHeight() */
+    int preferredHeight() const override;
 
 private:
-    QLineEditm_filterInput;
-    QToolButtonm_lockButton;
+    QLineEdit *m_filterInput;
+    QToolButton *m_lockButton;
 };
 
 #endif