1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00

Proper search tab changing logic

This commit is contained in:
DrabWeb 2017-05-19 19:13:07 -03:00
parent 7a60aa614d
commit c2ea2bb5b0

View File

@ -20,6 +20,7 @@ namespace osu.Game.Overlays
private readonly float panel_padding = 10f;
private readonly Box background;
private readonly Header header;
private readonly FilterControl filter;
private readonly FillFlowContainer<DirectPanel> panels;
@ -104,13 +105,16 @@ namespace osu.Game.Overlays
},
},
},
new Header
header = new Header
{
RelativeSizeAxes = Axes.X,
},
};
header.Tabs.Current.ValueChanged += (tab) => { if (tab != DirectTab.Search) filter.Search.Current.Value = @""; };
filter.Search.Exit = Hide;
filter.Search.Current.ValueChanged += (s) => { if (s != @"") header.Tabs.Current.Value = DirectTab.Search; };
filter.DisplayStyle.ValueChanged += recreatePanels;
}
@ -140,13 +144,13 @@ namespace osu.Game.Overlays
filter.Search.HoldFocus = false;
}
private class ContentFlow : FillFlowContainer<Drawable>
private class ContentFlow : FillFlowContainer<Drawable>
{
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
public ContentFlow()
{
{
Direction = FillDirection.Vertical;
}
}