mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
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>
This commit is contained in:
parent
ac9ead4571
commit
2cd31a30f2
3 changed files with 12 additions and 3 deletions
|
@ -104,4 +104,4 @@ private:
|
|||
bool justCleared;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -132,6 +132,9 @@ private:
|
|||
|
||||
class MultiFilter : public QScrollArea {
|
||||
Q_OBJECT
|
||||
public
|
||||
slots:
|
||||
void closeFilter();
|
||||
public:
|
||||
MultiFilter(QWidget *parent);
|
||||
QWidget *expandedWidget;
|
||||
|
|
Loading…
Add table
Reference in a new issue