Add a max height for the ladder settings dropdowns

This commit is contained in:
smoogipoo 2019-06-21 15:22:56 +09:00
parent ee30612a76
commit cffc82ce81
1 changed files with 21 additions and 2 deletions

View File

@ -8,6 +8,7 @@
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
using osu.Game.Screens.Play.PlayerSettings;
using osu.Game.Tournament.Components;
@ -80,7 +81,7 @@ protected override void OnHoverLost(HoverLostEvent e)
{
}
private class SettingsRoundDropdown : SettingsDropdown<TournamentRound>
private class SettingsRoundDropdown : LadderSettingsDropdown<TournamentRound>
{
public SettingsRoundDropdown(BindableList<TournamentRound> rounds)
{
@ -114,7 +115,7 @@ private void add(TournamentRound round)
}
}
private class SettingsTeamDropdown : SettingsDropdown<TournamentTeam>
private class SettingsTeamDropdown : LadderSettingsDropdown<TournamentTeam>
{
public SettingsTeamDropdown(BindableList<TournamentTeam> teams)
{
@ -145,5 +146,23 @@ private void add(TournamentTeam team)
});
}
}
private class LadderSettingsDropdown<T> : SettingsDropdown<T>
{
protected override OsuDropdown<T> CreateDropdown() => new DropdownControl();
private new class DropdownControl : SettingsDropdown<T>.DropdownControl
{
protected override DropdownMenu CreateMenu() => new Menu();
private new class Menu : OsuDropdownMenu
{
public Menu()
{
MaxHeight = 200;
}
}
}
}
}
}