Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions osu.Game/Overlays/Settings/SettingsSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,43 @@ public bool MatchingFilter

matchingFilter = value;

if (matchingFilter && FilteringActive)
showHorizontalSiblings();

if (IsPresent != wasPresent)
Invalidate(Invalidation.Presence);
}
}

private void showHorizontalSiblings()
{
foreach (var child in FlowContent)
{
if (child is FillFlowContainer { Direction: FillDirection.Horizontal } row)
{
bool hasVisibleButtons = false;

foreach (var item in row.Children)
{
if (item is IFilterable && item.IsPresent)
{
hasVisibleButtons = true;
break;
}
}

if (hasVisibleButtons)
{
foreach (var item in row.Children)
{
if (item is IFilterable filterable)
filterable.MatchingFilter = true;
}
}
}
}
}

public override bool IsPresent => base.IsPresent && MatchingFilter;

public bool FilteringActive { get; set; }
Expand Down
Loading