1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +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 DirectTab DefaultTab => DirectTab.Search;
protected override Drawable CreateHeaderText() => new OsuSpriteText { Text = @"osu!direct", TextSize = 25 }; protected override Drawable CreateHeaderText() => new OsuSpriteText { Text = @"osu!direct", TextSize = 25 };
protected override FontAwesome Icon => FontAwesome.fa_osu_chevron_down_o;
public Header() 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 float TabStripWidth { get; } //can be removed once (if?) TabControl support auto sizing
protected abstract T DefaultTab { get; } protected abstract T DefaultTab { get; }
protected abstract Drawable CreateHeaderText(); protected abstract Drawable CreateHeaderText();
protected abstract FontAwesome Icon { get; }
protected SearchableListHeader() protected SearchableListHeader()
{ {
@ -41,7 +42,7 @@ namespace osu.Game.Overlays.SearchableList
new Container new Container
{ {
RelativeSizeAxes = Axes.Both, 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[] Children = new Drawable[]
{ {
new FillFlowContainer new FillFlowContainer
@ -57,7 +58,7 @@ namespace osu.Game.Overlays.SearchableList
new TextAwesome new TextAwesome
{ {
TextSize = 25, TextSize = 25,
Icon = FontAwesome.fa_osu_chevron_down_o, Icon = Icon,
}, },
CreateHeaderText(), CreateHeaderText(),
}, },

View File

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

View File

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