From e1d88c4d69ba0fb38951954dceab937741528eab Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Thu, 5 Sep 2013 16:22:59 +0200 Subject: Fix Bug 296970 - split view wrong behavior with search tab Implemented setActive(bool active), isActive() and activated() signal for DolphinSearchBox - similar to the KUrlNavigator implementation. BUG: 296970 FIXED-IN: 4.11.2 REVIEW: 112534 --- src/search/dolphinsearchbox.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/search/dolphinsearchbox.h') diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index f3cc535d6..e4c14b7cb 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -87,10 +87,27 @@ public: void setReadOnly(bool readOnly, const KUrl& query = KUrl()); bool isReadOnly() const; + /** + * Set the search box to the active mode, if \a active + * is true. The active mode is default. The inactive mode only differs + * visually from the active mode, no change of the behavior is given. + * + * Using the search box in the inactive mode is useful when having split views, + * where the inactive view is indicated by an search box visually. + */ + void setActive(bool active); + + /** + * @return True, if the search box is in the active mode. + * @see DolphinSearchBox::setActive() + */ + bool isActive() const; + protected: virtual bool event(QEvent* event); virtual void showEvent(QShowEvent* event); virtual void keyReleaseEvent(QKeyEvent* event); + virtual bool eventFilter(QObject* obj, QEvent* event); signals: /** @@ -111,6 +128,13 @@ signals: */ void closeRequest(); + /** + * Is emitted, if the searchbox has been activated by + * an user interaction + * @see DolphinSearchBox::setActive() + */ + void activated(); + private slots: void emitSearchRequest(); void emitCloseRequest(); @@ -137,6 +161,7 @@ private: private: bool m_startedSearching; bool m_readOnly; + bool m_active; QVBoxLayout* m_topLayout; -- cgit v1.3.1