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

Make SearchableListHeader icon customisable

This commit is contained in:
Dean Herbert 2017-06-07 20:06:02 +09:00
parent 6a12173175
commit fc2d9816df
4 changed files with 17 additions and 16 deletions

View File

@ -17,6 +17,7 @@ namespace osu.Game.Overlays.Direct
protected override DirectTab DefaultTab => DirectTab.Search;
protected override Drawable CreateHeaderText() => new OsuSpriteText { Text = @"osu!direct", TextSize = 25 };
protected override FontAwesome Icon => FontAwesome.fa_osu_chevron_down_o;
public Header()
{

View File

@ -22,6 +22,7 @@ namespace osu.Game.Overlays.SearchableList
protected abstract float TabStripWidth { get; } //can be removed once (if?) TabControl support auto sizing
protected abstract T DefaultTab { get; }
protected abstract Drawable CreateHeaderText();
protected abstract FontAwesome Icon { get; }
protected SearchableListHeader()
{
@ -41,7 +42,7 @@ namespace osu.Game.Overlays.SearchableList
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = SearchableListOverlay.WIDTH_PADDING, Right = SearchableListOverlay.WIDTH_PADDING }, 
Padding = new MarginPadding { Left = SearchableListOverlay.WIDTH_PADDING, Right = SearchableListOverlay.WIDTH_PADDING },
Children = new Drawable[]
{
new FillFlowContainer
@ -57,7 +58,7 @@ namespace osu.Game.Overlays.SearchableList
new TextAwesome
{
TextSize = 25,
Icon = FontAwesome.fa_osu_chevron_down_o,
Icon = Icon,
},
CreateHeaderText(),
},

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Game.Graphics;
@ -12,7 +11,7 @@ namespace osu.Game.Overlays.Social
public class FilterControl : SearchableListFilterControl<SocialSortCriteria, SortDirection>
{
protected override Color4 BackgroundColour => OsuColour.FromHex(@"47253a");
protected override SocialSortCriteria DefaultTab => SocialSortCriteria.Name;
protected override SocialSortCriteria DefaultTab => SocialSortCriteria.Rank;
public FilterControl()
{
@ -22,12 +21,11 @@ namespace osu.Game.Overlays.Social
public enum SocialSortCriteria
{
Name,
Rank,
Location,
[Description("Time Zone")]
TimeZone,
[Description("World Map")]
WorldMap,
//Location,
//[Description("Time Zone")]
//TimeZone,
//[Description("World Map")]
//WorldMap,
}
}

View File

@ -19,6 +19,7 @@ namespace osu.Game.Overlays.Social
protected override Color4 BackgroundColour => OsuColour.FromHex(@"38202e");
protected override float TabStripWidth => 438;
protected override SocialTab DefaultTab => SocialTab.OnlinePlayers;
protected override FontAwesome Icon => FontAwesome.fa_users;
protected override Drawable CreateHeaderText()
{
@ -54,11 +55,11 @@ namespace osu.Game.Overlays.Social
{
[Description("Online Players")]
OnlinePlayers,
[Description("Online Friends")]
OnlineFriends,
[Description("Online Team Members")]
OnlineTeamMembers,
[Description("Chat Channels")]
ChatChannels,
//[Description("Online Friends")]
//OnlineFriends,
//[Description("Online Team Members")]
//OnlineTeamMembers,
//[Description("Chat Channels")]
//ChatChannels,
}
}