A game framework written with osu! in mind.

Fix regression

+29 -4
+15
osu.Framework.Tests/Visual/UserInterface/TestCaseSearchContainer.cs
··· 137 137 } 138 138 } 139 139 140 + public bool FilteringActive 141 + { 142 + set { } 143 + } 144 + 140 145 public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>(); 141 146 142 147 protected override Container<Drawable> Content => flowContainer; ··· 173 178 Hide(); 174 179 } 175 180 } 181 + 182 + public bool FilteringActive 183 + { 184 + set { } 185 + } 176 186 } 177 187 178 188 private class SearchableText : SpriteText, IFilterable ··· 186 196 else 187 197 Hide(); 188 198 } 199 + } 200 + 201 + public bool FilteringActive 202 + { 203 + set { } 189 204 } 190 205 } 191 206 }
+5
osu.Framework/Graphics/Containers/IFilterable.cs
··· 9 9 /// Whether the current object is matching (ie. visible) given the current filter criteria of a parent. 10 10 /// </summary> 11 11 bool MatchingFilter { set; } 12 + 13 + /// <summary> 14 + /// Whether a filter is currently being performed. 15 + /// </summary> 16 + bool FilteringActive { set; } 12 17 } 13 18 }
+4 -3
osu.Framework/Graphics/Containers/SearchContainer.cs
··· 26 26 { 27 27 searchTerm = value; 28 28 var terms = value.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); 29 - Children.OfType<IFilterable>().ForEach(child => match(child, terms)); 29 + Children.OfType<IFilterable>().ForEach(child => match(child, terms, terms.Length > 0)); 30 30 } 31 31 } 32 32 33 - private static bool match(IFilterable filterable, IEnumerable<string> terms) 33 + private static bool match(IFilterable filterable, IEnumerable<string> terms, bool searchActive) 34 34 { 35 35 //Words matched by parent is not needed to match children 36 36 var childTerms = terms.Where(term => ··· 44 44 //We need to check the children and should any child match this matches as well 45 45 if (hasFilterableChildren != null) 46 46 foreach (IFilterable child in hasFilterableChildren.FilterableChildren) 47 - matching |= match(child, childTerms); 47 + matching |= match(child, childTerms, searchActive); 48 48 49 + filterable.FilteringActive = searchActive; 49 50 return filterable.MatchingFilter = matching; 50 51 } 51 52 }
+3 -1
osu.Framework/Testing/Drawables/TestCaseButton.cs
··· 30 30 } 31 31 } 32 32 33 + public bool FilteringActive { get; set; } 34 + 33 35 private readonly Container content; 34 36 private readonly TextFlowContainer text; 35 37 public readonly Type TestType; ··· 113 115 114 116 private void updateVisibility() 115 117 { 116 - if (matchingFilter || !collapsed) 118 + if (FilteringActive && matchingFilter || !collapsed) 117 119 Show(); 118 120 else 119 121 Hide();
+2
osu.Framework/Testing/Drawables/TestCaseButtonGroup.cs
··· 19 19 set => Alpha = value ? 1 : 0; 20 20 } 21 21 22 + public bool FilteringActive { get; set; } 23 + 22 24 public IEnumerable<IFilterable> FilterableChildren => buttonFlow.Children; 23 25 24 26 private readonly FillFlowContainer<TestCaseButton> buttonFlow;