mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 14:02:55 +08:00
Proper search tab changing logic
This commit is contained in:
parent
7a60aa614d
commit
c2ea2bb5b0
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user