1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 07:23:14 +08:00

Browser - SearchableList

This commit is contained in:
DrabWeb 2017-05-26 02:44:09 -03:00
parent 5831da6978
commit 68377494f7
13 changed files with 43 additions and 43 deletions

View File

@ -9,11 +9,11 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Overlays.Browse;
using osu.Game.Overlays.SearchableList;
namespace osu.Game.Overlays.Direct
{
public class FilterControl : BrowseFilterControl<DirectSortCritera>
public class FilterControl : SearchableListFilterControl<DirectSortCritera>
{
private FillFlowContainer<RulesetToggleButton> modeButtons;
@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Direct
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding { Bottom = 5, Right = BrowseOverlay.WIDTH_PADDING },
Margin = new MarginPadding { Bottom = 5, Right = SearchableListOverlay.WIDTH_PADDING },
});
}

View File

@ -6,11 +6,11 @@ using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Browse;
using osu.Game.Overlays.SearchableList;
namespace osu.Game.Overlays.Direct
{
public class Header : BrowseHeader<DirectTab>
public class Header : SearchableListHeader<DirectTab>
{
protected override Color4 BackgroundColour => OsuColour.FromHex(@"252f3a");
protected override float TabStripWidth => 298;

View File

@ -11,13 +11,13 @@ using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Direct;
using osu.Game.Overlays.Browse;
using osu.Game.Overlays.SearchableList;
using OpenTK.Graphics;
using System;
namespace osu.Game.Overlays
{
public class DirectOverlay : BrowseOverlay<DirectTab,DirectSortCritera>
public class DirectOverlay : SearchableListOverlay<DirectTab,DirectSortCritera>
{
private const float panel_padding = 10f;
@ -29,8 +29,8 @@ namespace osu.Game.Overlays
protected override Color4 TrianglesColourLight => OsuColour.FromHex(@"465b71");
protected override Color4 TrianglesColourDark => OsuColour.FromHex(@"3f5265");
protected override BrowseHeader<DirectTab> CreateHeader() => new Header();
protected override BrowseFilterControl<DirectSortCritera> CreateFilterControl() => new FilterControl();
protected override SearchableListHeader<DirectTab> CreateHeader() => new Header();
protected override SearchableListFilterControl<DirectSortCritera> CreateFilterControl() => new FilterControl();
private IEnumerable<BeatmapSetInfo> beatmapSets;
public IEnumerable<BeatmapSetInfo> BeatmapSets

View File

@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Browse
namespace osu.Game.Overlays.SearchableList
{
public class DisplayStyleControl<T> : Container
{

View File

@ -5,7 +5,7 @@ using OpenTK.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Browse
namespace osu.Game.Overlays.SearchableList
{
public class HeaderTabControl<T> : OsuTabControl<T>
{

View File

@ -11,9 +11,9 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Browse
namespace osu.Game.Overlays.SearchableList
{
public abstract class BrowseFilterControl<T> : Container
public abstract class SearchableListFilterControl<T> : Container
{
private const float padding = 10;
@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Browse
protected abstract T DefaultTab { get; }
protected virtual Drawable CreateSupplementaryControls() => null;
public BrowseFilterControl()
public SearchableListFilterControl()
{
if (!typeof(T).IsEnum)
throw new InvalidOperationException("BrowseFilterControl only supports enums as the generic type argument");
@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Browse
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Top = padding, Horizontal = BrowseOverlay.WIDTH_PADDING },
Padding = new MarginPadding { Top = padding, Horizontal = SearchableListOverlay.WIDTH_PADDING },
Children = new Drawable[]
{
Search = new FilterSearchTextBox

View File

@ -10,9 +10,9 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Browse
namespace osu.Game.Overlays.SearchableList
{
public abstract class BrowseHeader<T> : Container
public abstract class SearchableListHeader<T> : Container
{
public static readonly float HEIGHT = 90;
@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Browse
protected abstract T DefaultTab { get; }
protected abstract Drawable CreateHeaderText();
public BrowseHeader()
public SearchableListHeader()
{
if (!typeof(T).IsEnum)
throw new InvalidOperationException("BrowseHeader only supports enums as the generic type argument");
@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Browse
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = BrowseOverlay.WIDTH_PADDING, Right = BrowseOverlay.WIDTH_PADDING }, 
Padding = new MarginPadding { Left = SearchableListOverlay.WIDTH_PADDING, Right = SearchableListOverlay.WIDTH_PADDING }, 
Children = new Drawable[]
{
new FillFlowContainer

View File

@ -8,29 +8,29 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Graphics.Backgrounds;
namespace osu.Game.Overlays.Browse
namespace osu.Game.Overlays.SearchableList
{
public abstract class BrowseOverlay : WaveOverlayContainer
public abstract class SearchableListOverlay : WaveOverlayContainer
{
public static readonly float WIDTH_PADDING = 80;
}
//todo: naming
public abstract class BrowseOverlay<T,U> : BrowseOverlay
public abstract class SearchableListOverlay<T,U> : SearchableListOverlay
{
private readonly Container scrollContainer;
protected readonly BrowseHeader<T> Header;
protected readonly BrowseFilterControl<U> Filter;
protected readonly SearchableListHeader<T> Header;
protected readonly SearchableListFilterControl<U> Filter;
protected readonly FillFlowContainer ScrollFlow;
protected abstract Color4 BackgroundColour { get; }
protected abstract Color4 TrianglesColourLight { get; }
protected abstract Color4 TrianglesColourDark { get; }
protected abstract BrowseHeader<T> CreateHeader();
protected abstract BrowseFilterControl<U> CreateFilterControl();
protected abstract SearchableListHeader<T> CreateHeader();
protected abstract SearchableListFilterControl<U> CreateFilterControl();
public BrowseOverlay()
public SearchableListOverlay()
{
RelativeSizeAxes = Axes.Both;
@ -82,7 +82,7 @@ namespace osu.Game.Overlays.Browse
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = BrowseOverlay.WIDTH_PADDING },
Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING },
Direction = FillDirection.Vertical,
},
},

View File

@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Browse
namespace osu.Game.Overlays.SearchableList
{
public class SlimEnumDropdown<T> : OsuEnumDropdown<T>
{

View File

@ -4,11 +4,11 @@
using System.ComponentModel;
using OpenTK.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Browse;
using osu.Game.Overlays.SearchableList;
namespace osu.Game.Overlays.Social
{
public class FilterControl : BrowseFilterControl<SocialSortCriteria>
public class FilterControl : SearchableListFilterControl<SocialSortCriteria>
{
protected override Color4 BackgroundColour => OsuColour.FromHex(@"47253a");
protected override SocialSortCriteria DefaultTab => SocialSortCriteria.Name;

View File

@ -1,7 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Overlays.Browse;
using osu.Game.Overlays.SearchableList;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
@ -12,7 +12,7 @@ using System.ComponentModel;
namespace osu.Game.Overlays.Social
{
public class Header : BrowseHeader<SocialTab>
public class Header : SearchableListHeader<SocialTab>
{
private OsuSpriteText browser;

View File

@ -8,13 +8,13 @@ using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Overlays.Browse;
using osu.Game.Overlays.SearchableList;
using osu.Game.Overlays.Social;
using osu.Game.Users;
namespace osu.Game.Overlays
{
public class SocialOverlay : BrowseOverlay<SocialTab, SocialSortCriteria>
public class SocialOverlay : SearchableListOverlay<SocialTab, SocialSortCriteria>
{
private readonly FillFlowContainer<UserPanel> panelFlow;
@ -22,8 +22,8 @@ namespace osu.Game.Overlays
protected override Color4 TrianglesColourLight => OsuColour.FromHex(@"672b51");
protected override Color4 TrianglesColourDark => OsuColour.FromHex(@"5c2648");
protected override BrowseFilterControl<SocialSortCriteria> CreateFilterControl() => new FilterControl();
protected override BrowseHeader<SocialTab> CreateHeader() => new Header();
protected override SearchableListHeader<SocialTab> CreateHeader() => new Header();
protected override SearchableListFilterControl<SocialSortCriteria> CreateFilterControl() => new FilterControl();
private IEnumerable<User> users;
public IEnumerable<User> Users

View File

@ -448,16 +448,16 @@
<Compile Include="Database\BeatmapOnlineInfo.cs" />
<Compile Include="Graphics\Containers\ReverseDepthFillFlowContainer.cs" />
<Compile Include="Database\RankStatus.cs" />
<Compile Include="Overlays\Browse\BrowseHeader.cs" />
<Compile Include="Overlays\Browse\HeaderTabControl.cs" />
<Compile Include="Overlays\SearchableList\SearchableListHeader.cs" />
<Compile Include="Overlays\SearchableList\HeaderTabControl.cs" />
<Compile Include="Overlays\Social\FilterControl.cs" />
<Compile Include="Overlays\Social\Header.cs" />
<Compile Include="Overlays\Browse\BrowseFilterControl.cs" />
<Compile Include="Overlays\Browse\BrowseOverlay.cs" />
<Compile Include="Overlays\SearchableList\SearchableListFilterControl.cs" />
<Compile Include="Overlays\SearchableList\SearchableListOverlay.cs" />
<Compile Include="Graphics\UserInterface\PageTabControl.cs" />
<Compile Include="Overlays\SocialOverlay.cs" />
<Compile Include="Overlays\Browse\SlimEnumDropdown.cs" />
<Compile Include="Overlays\Browse\DisplayStyleControl.cs" />
<Compile Include="Overlays\SearchableList\SlimEnumDropdown.cs" />
<Compile Include="Overlays\SearchableList\DisplayStyleControl.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">