1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 10:17:19 +08:00
This commit is contained in:
DrabWeb 2017-05-26 03:10:36 -03:00
parent 28ee00109d
commit 5785715ad5
5 changed files with 8 additions and 10 deletions

View File

@ -137,7 +137,7 @@ namespace osu.Game.Overlays
private void withDisplayStyleControl(Action<DisplayStyleControl<RankStatus>> action) private void withDisplayStyleControl(Action<DisplayStyleControl<RankStatus>> action)
{ {
var f = (Filter as FilterControl); var f = Filter as FilterControl;
if (f != null) action.Invoke(f.DisplayStyleControl); if (f != null) action.Invoke(f.DisplayStyleControl);
} }

View File

@ -26,7 +26,7 @@ namespace osu.Game.Overlays.SearchableList
protected abstract T DefaultTab { get; } protected abstract T DefaultTab { get; }
protected virtual Drawable CreateSupplementaryControls() => null; protected virtual Drawable CreateSupplementaryControls() => null;
public SearchableListFilterControl() protected SearchableListFilterControl()
{ {
if (!typeof(T).IsEnum) if (!typeof(T).IsEnum)
throw new InvalidOperationException("BrowseFilterControl only supports enums as the generic type argument"); throw new InvalidOperationException("BrowseFilterControl only supports enums as the generic type argument");

View File

@ -14,8 +14,6 @@ namespace osu.Game.Overlays.SearchableList
{ {
public abstract class SearchableListHeader<T> : Container public abstract class SearchableListHeader<T> : Container
{ {
public static readonly float HEIGHT = 90;
private readonly Box tabStrip; private readonly Box tabStrip;
public readonly HeaderTabControl<T> Tabs; public readonly HeaderTabControl<T> Tabs;
@ -25,13 +23,13 @@ namespace osu.Game.Overlays.SearchableList
protected abstract T DefaultTab { get; } protected abstract T DefaultTab { get; }
protected abstract Drawable CreateHeaderText(); protected abstract Drawable CreateHeaderText();
public SearchableListHeader() protected SearchableListHeader()
{ {
if (!typeof(T).IsEnum) if (!typeof(T).IsEnum)
throw new InvalidOperationException("BrowseHeader only supports enums as the generic type argument"); throw new InvalidOperationException("BrowseHeader only supports enums as the generic type argument");
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = HEIGHT; Height = 90;
Children = new Drawable[] Children = new Drawable[]
{ {
@ -54,7 +52,7 @@ namespace osu.Game.Overlays.SearchableList
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(10f, 0f), Spacing = new Vector2(10f, 0f),
Children = new Drawable[] Children = new[]
{ {
new TextAwesome new TextAwesome
{ {

View File

@ -30,7 +30,7 @@ namespace osu.Game.Overlays.SearchableList
protected abstract SearchableListHeader<T> CreateHeader(); protected abstract SearchableListHeader<T> CreateHeader();
protected abstract SearchableListFilterControl<U> CreateFilterControl(); protected abstract SearchableListFilterControl<U> CreateFilterControl();
public SearchableListOverlay() protected SearchableListOverlay()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
@ -82,7 +82,7 @@ namespace osu.Game.Overlays.SearchableList
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING }, Padding = new MarginPadding { Horizontal = WIDTH_PADDING },
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
}, },
}, },

View File

@ -31,7 +31,7 @@ namespace osu.Game.Overlays
get { return users; } get { return users; }
set set
{ {
if (users == value) return; if (users?.Equals(value) ?? false) return;
users = value; users = value;
panelFlow.Children = users.Select(u => panelFlow.Children = users.Select(u =>