diff --git a/osu.Game/Overlays/Settings/SettingsSection.cs b/osu.Game/Overlays/Settings/SettingsSection.cs index 5a57114deb4c..1e0acb4f9145 100644 --- a/osu.Game/Overlays/Settings/SettingsSection.cs +++ b/osu.Game/Overlays/Settings/SettingsSection.cs @@ -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; }