diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c33fd158..d393f7b8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Minor: Added a setting to hide similar messages by any user. (#2716) - Minor: Duplicate spaces now count towards the display message length. (#3002) - Minor: Commands are now backed up. (#3168) +- Minor: Subcategories in settings are now searchable. (#3157) - Minor: Added the ability to open an entire tab as a popup. (#3082) - Minor: Added optional parameter to /usercard command for opening a usercard in a different channel context. (#3172) - Minor: Added regex option to Nicknames. (#3146) diff --git a/src/widgets/settingspages/GeneralPageView.cpp b/src/widgets/settingspages/GeneralPageView.cpp index 963047efc..f9accba3d 100644 --- a/src/widgets/settingspages/GeneralPageView.cpp +++ b/src/widgets/settingspages/GeneralPageView.cpp @@ -291,22 +291,30 @@ bool GeneralPageView::filterElements(const QString &query) QWidget *currentSubtitle = nullptr; bool currentSubtitleVisible = false; + bool currentSubtitleSearched = false; for (auto &&widget : group.widgets) { - if (dynamic_cast(widget.element)) + if (auto x = dynamic_cast(widget.element)) { + currentSubtitleSearched = false; if (currentSubtitle) currentSubtitle->setVisible(currentSubtitleVisible); currentSubtitleVisible = false; currentSubtitle = widget.element; + + if (x->text().contains(query, Qt::CaseInsensitive)) + { + currentSubtitleSearched = true; + } continue; } for (auto &&keyword : widget.keywords) { - if (keyword.contains(query, Qt::CaseInsensitive)) + if (keyword.contains(query, Qt::CaseInsensitive) || + currentSubtitleSearched) { currentSubtitleVisible = true; widget.element->show();