feat: make filters searchable with Settings dialog search (#5890)
This commit is contained in:
@@ -31,6 +31,7 @@ FiltersPage::FiltersPage()
|
||||
(new FilterModel(nullptr))
|
||||
->initialized(&getSettings()->filterRecords))
|
||||
.getElement();
|
||||
this->view_ = view;
|
||||
|
||||
view->setTitles({"Name", "Filter", "Valid"});
|
||||
view->getTableView()->horizontalHeader()->setSectionResizeMode(
|
||||
@@ -130,4 +131,11 @@ void FiltersPage::tableCellClicked(const QModelIndex &clicked,
|
||||
}
|
||||
}
|
||||
|
||||
bool FiltersPage::filterElements(const QString &query)
|
||||
{
|
||||
std::array fields{0, 1};
|
||||
|
||||
return this->view_->filterSearchResults(query, fields);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -16,11 +16,13 @@ public:
|
||||
FiltersPage();
|
||||
|
||||
void onShow() final;
|
||||
bool filterElements(const QString &query) override;
|
||||
|
||||
private:
|
||||
void tableCellClicked(const QModelIndex &clicked, EditableModelView *view);
|
||||
|
||||
QStringListModel userListModel_;
|
||||
EditableModelView *view_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user