Choose default category sorting instead of being always first

This commit is contained in:
Joehu 2019-08-02 13:22:58 -07:00
parent e84c79d140
commit 0082695cd8
4 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,7 @@ public class FilterControl : SearchableListFilterControl<DirectSortCriteria, Bea
protected override Color4 BackgroundColour => OsuColour.FromHex(@"384552");
protected override DirectSortCriteria DefaultTab => DirectSortCriteria.Ranked;
protected override BeatmapSearchCategory DefaultCategory => BeatmapSearchCategory.Leaderboard;
protected override Drawable CreateSupplementaryControls() => rulesetSelector = new DirectRulesetSelector();

View File

@ -26,6 +26,7 @@ public abstract class SearchableListFilterControl<T, U> : Container
protected abstract Color4 BackgroundColour { get; }
protected abstract T DefaultTab { get; }
protected abstract U DefaultCategory { get; }
protected virtual Drawable CreateSupplementaryControls() => null;
/// <summary>
@ -109,6 +110,9 @@ protected SearchableListFilterControl()
Tabs.Current.Value = DefaultTab;
Tabs.Current.TriggerChange();
DisplayStyleControl.Dropdown.Current.Value = DefaultCategory;
DisplayStyleControl.Dropdown.Current.TriggerChange();
}
[BackgroundDependencyLoader]

View File

@ -12,6 +12,7 @@ public class FilterControl : SearchableListFilterControl<SocialSortCriteria, Sor
{
protected override Color4 BackgroundColour => OsuColour.FromHex(@"47253a");
protected override SocialSortCriteria DefaultTab => SocialSortCriteria.Rank;
protected override SortDirection DefaultCategory => SortDirection.Ascending;
public FilterControl()
{

View File

@ -14,6 +14,7 @@ public class FilterControl : SearchableListFilterControl<PrimaryFilter, Secondar
{
protected override Color4 BackgroundColour => OsuColour.FromHex(@"362e42");
protected override PrimaryFilter DefaultTab => PrimaryFilter.Open;
protected override SecondaryFilter DefaultCategory => SecondaryFilter.Public;
protected override float ContentHorizontalPadding => base.ContentHorizontalPadding + OsuScreen.HORIZONTAL_OVERFLOW_PADDING;