diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-13 13:45:32 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-13 13:46:19 -0800 |
commit | 2cd31a30f26480553dcbd403f5ba51a345e0939d (patch) | |
tree | 9f1a03840165271da2674a4412281d64db038412 /qt-ui | |
parent | ac9ead4571f3c1546c0cd88a39088f91b01929b3 (diff) | |
download | subsurface-2cd31a30f26480553dcbd403f5ba51a345e0939d.tar.gz |
When closing the filter window also clear the filter
The tooltip already pretended that that's what it did...
Also make the tooltip wording consistent.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/filtermodels.h | 2 | ||||
-rw-r--r-- | qt-ui/simplewidgets.cpp | 10 | ||||
-rw-r--r-- | qt-ui/simplewidgets.h | 3 |
3 files changed, 12 insertions, 3 deletions
diff --git a/qt-ui/filtermodels.h b/qt-ui/filtermodels.h index 7e75a8b13..b8439bb81 100644 --- a/qt-ui/filtermodels.h +++ b/qt-ui/filtermodels.h @@ -104,4 +104,4 @@ private: bool justCleared; }; -#endif
\ No newline at end of file +#endif diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 161f4f14a..192682774 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -577,7 +577,7 @@ MultiFilter::MultiFilter(QWidget *parent) : QScrollArea(parent) // Buttons to Clear/Minimize/Close QToolBar *tb = new QToolBar(); QToolButton *clearBtn = new QToolButton(); - clearBtn->setToolTip(tr("Clear the filters")); + clearBtn->setToolTip(tr("Reset the filters")); clearBtn->setIcon(QIcon(":/trash")); clearBtn->setAutoRaise(true); QToolButton *closeBtn = new QToolButton(); @@ -594,7 +594,7 @@ MultiFilter::MultiFilter(QWidget *parent) : QScrollArea(parent) tb->addWidget(minimize); tb->addWidget(closeBtn); - connect(closeBtn, SIGNAL(clicked(bool)), this, SLOT(hide())); + connect(closeBtn, SIGNAL(clicked(bool)), this, SLOT(closeFilter())); connect(clearBtn, SIGNAL(clicked(bool)), MultiFilterSortModel::instance(), SLOT(clearFilter())); l->addWidget(tb); l->addWidget(tagFilter); @@ -610,3 +610,9 @@ MultiFilter::MultiFilter(QWidget *parent) : QScrollArea(parent) setMinimumHeight(expandedWidget->height() + 5); } + +void MultiFilter::closeFilter() +{ + MultiFilterSortModel::instance()->clearFilter(); + hide(); +} diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index 25ef654a6..68735451e 100644 --- a/qt-ui/simplewidgets.h +++ b/qt-ui/simplewidgets.h @@ -132,6 +132,9 @@ private: class MultiFilter : public QScrollArea { Q_OBJECT +public +slots: + void closeFilter(); public: MultiFilter(QWidget *parent); QWidget *expandedWidget; |