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:
@@ -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<SubtitleLabel *>(widget.element))
|
||||
if (auto x = dynamic_cast<SubtitleLabel *>(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();
|
||||
|
||||
Reference in New Issue
Block a user