feat: make filters searchable with Settings dialog search (#5890)

This commit is contained in:
apa420
2025-04-13 12:51:04 +00:00
committed by GitHub
parent 1d8a00e892
commit acea118466
3 changed files with 11 additions and 0 deletions
@@ -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