mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fixed Searching for subcategories (#3157)
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> Co-authored-by: Paweł <zneix@zneix.eu> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
696979e9a3
commit
4a90f10df9
|
@ -11,6 +11,7 @@
|
||||||
- Minor: Added a setting to hide similar messages by any user. (#2716)
|
- Minor: Added a setting to hide similar messages by any user. (#2716)
|
||||||
- Minor: Duplicate spaces now count towards the display message length. (#3002)
|
- Minor: Duplicate spaces now count towards the display message length. (#3002)
|
||||||
- Minor: Commands are now backed up. (#3168)
|
- 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 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 optional parameter to /usercard command for opening a usercard in a different channel context. (#3172)
|
||||||
- Minor: Added regex option to Nicknames. (#3146)
|
- Minor: Added regex option to Nicknames. (#3146)
|
||||||
|
|
|
@ -291,22 +291,30 @@ bool GeneralPageView::filterElements(const QString &query)
|
||||||
|
|
||||||
QWidget *currentSubtitle = nullptr;
|
QWidget *currentSubtitle = nullptr;
|
||||||
bool currentSubtitleVisible = false;
|
bool currentSubtitleVisible = false;
|
||||||
|
bool currentSubtitleSearched = false;
|
||||||
|
|
||||||
for (auto &&widget : group.widgets)
|
for (auto &&widget : group.widgets)
|
||||||
{
|
{
|
||||||
if (dynamic_cast<SubtitleLabel *>(widget.element))
|
if (auto x = dynamic_cast<SubtitleLabel *>(widget.element))
|
||||||
{
|
{
|
||||||
|
currentSubtitleSearched = false;
|
||||||
if (currentSubtitle)
|
if (currentSubtitle)
|
||||||
currentSubtitle->setVisible(currentSubtitleVisible);
|
currentSubtitle->setVisible(currentSubtitleVisible);
|
||||||
|
|
||||||
currentSubtitleVisible = false;
|
currentSubtitleVisible = false;
|
||||||
currentSubtitle = widget.element;
|
currentSubtitle = widget.element;
|
||||||
|
|
||||||
|
if (x->text().contains(query, Qt::CaseInsensitive))
|
||||||
|
{
|
||||||
|
currentSubtitleSearched = true;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &&keyword : widget.keywords)
|
for (auto &&keyword : widget.keywords)
|
||||||
{
|
{
|
||||||
if (keyword.contains(query, Qt::CaseInsensitive))
|
if (keyword.contains(query, Qt::CaseInsensitive) ||
|
||||||
|
currentSubtitleSearched)
|
||||||
{
|
{
|
||||||
currentSubtitleVisible = true;
|
currentSubtitleVisible = true;
|
||||||
widget.element->show();
|
widget.element->show();
|
||||||
|
|
Loading…
Reference in a new issue