diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-07-02 10:40:38 (GMT) |
---|---|---|
committer | Richard Maudsley <richard.maudsley@isode.com> | 2014-07-08 09:11:59 (GMT) |
commit | 8ab7ca17fdde8f8fb62a0c574478aa2c4c01a9bc (patch) | |
tree | 26a3b88639149370fcd231bd102bc37e039b07d3 /Swift/QtUI/Roster | |
parent | b4fe7ad5c1036b1d24470d9f8e0888faf582530a (diff) | |
download | swift-8ab7ca17fdde8f8fb62a0c574478aa2c4c01a9bc.zip swift-8ab7ca17fdde8f8fb62a0c574478aa2c4c01a9bc.tar.bz2 |
Added close/clear button to roster filter search term box.
Test-Information:
Verify that the clear button resets the roster filter and hides the search box. Verify that the roster filter continues to behave as normal.
Change-Id: Ifa5de1e611334b83634ac31d30bf912fd5c4da87
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r-- | Swift/QtUI/Roster/QtFilterWidget.cpp | 17 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtFilterWidget.h | 6 |
2 files changed, 14 insertions, 9 deletions
diff --git a/Swift/QtUI/Roster/QtFilterWidget.cpp b/Swift/QtUI/Roster/QtFilterWidget.cpp index 2f08981..a4c9449 100644 --- a/Swift/QtUI/Roster/QtFilterWidget.cpp +++ b/Swift/QtUI/Roster/QtFilterWidget.cpp @@ -1,17 +1,24 @@ /* + * Copyright (c) 2014 Kevin Smith and Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +/* * Copyright (c) 2013 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ -#include <QLayout> -#include <QVBoxLayout> -#include <QKeyEvent> #include <QEvent> +#include <QKeyEvent> +#include <QLayout> #include <QString> -#include <QEvent> +#include <QVBoxLayout> + #include <Swift/Controllers/UIEvents/RequestChatUIEvent.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> +#include <Swift/QtUI/QtClosableLineEdit.h> #include <Swift/QtUI/QtSwiftUtil.h> #include <Swift/QtUI/Roster/QtFilterWidget.h> @@ -24,7 +31,7 @@ QtFilterWidget::QtFilterWidget(QWidget* parent, QtTreeWidget* treeView, UIEventS vboxLayout->setSpacing(0); vboxLayout->setContentsMargins(0,0,0,0); - filterLineEdit_ = new QLineEdit(this); + filterLineEdit_ = new QtClosableLineEdit(this); filterLineEdit_->hide(); vboxLayout->addWidget(filterLineEdit_); diff --git a/Swift/QtUI/Roster/QtFilterWidget.h b/Swift/QtUI/Roster/QtFilterWidget.h index 94ebc2a..3e17566 100644 --- a/Swift/QtUI/Roster/QtFilterWidget.h +++ b/Swift/QtUI/Roster/QtFilterWidget.h @@ -9,7 +9,6 @@ #include <vector> #include <QBoxLayout> -#include <QLineEdit> #include <QWidget> #include <Swift/Controllers/Roster/RosterFilter.h> @@ -18,9 +17,8 @@ #include <Swift/QtUI/Roster/QtTreeWidget.h> namespace Swift { - class UIEventStream; - +class QtClosableLineEdit; class QtFilterWidget : public QWidget { Q_OBJECT public: @@ -38,7 +36,7 @@ class QtFilterWidget : public QWidget { void updateSearchFilter(); private: - QLineEdit* filterLineEdit_; + QtClosableLineEdit* filterLineEdit_; QtTreeWidget* treeView_; UIEventStream* eventStream_; std::vector<RosterFilter*> filters_; |