Added searching

This commit is contained in:
DrabWeb
2017-05-20 20:22:55 -03:00
parent 47dfc0d7bc
commit 2e1d01a268
3 changed files with 30 additions and 12 deletions

View File

@ -11,25 +11,30 @@ using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat
{
public class ChannelSection : Container
public class ChannelSection : Container, IHasFilterableChildren
{
private readonly FillFlowContainer<ChannelListItem> items;
private readonly OsuSpriteText header;
public IEnumerable<IFilterable> FilterableChildren => items.Children.OfType<IFilterable>();
public string[] FilterTerms => new[] { Header };
public bool MatchingCurrentFilter
{
set
{
FadeTo(value ? 1f : 0f, 100);
}
}
public string Header
{
set
{
header.Text = value;
}
get { return header.Text; }
set { header.Text = value; }
}
public IEnumerable<Channel> Channels
{
set
{
items.Children = value.Select(c => new ChannelListItem { Channel = c });
}
set { items.Children = value.Select(c => new ChannelListItem { Channel = c }); }
}
public ChannelSection()