mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Move labelled dropdown from tournament to main game
This commit is contained in:
31
osu.Game/Graphics/UserInterfaceV2/LabelledDropdown.cs
Normal file
31
osu.Game/Graphics/UserInterfaceV2/LabelledDropdown.cs
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterfaceV2
|
||||
{
|
||||
public class LabelledDropdown<TItem> : LabelledComponent<OsuDropdown<TItem>, TItem>
|
||||
{
|
||||
public LabelledDropdown()
|
||||
: base(true)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<TItem> Items
|
||||
{
|
||||
get => Component.Items;
|
||||
set => Component.Items = value;
|
||||
}
|
||||
|
||||
protected sealed override OsuDropdown<TItem> CreateComponent() => CreateDropdown().With(d =>
|
||||
{
|
||||
d.RelativeSizeAxes = Axes.X;
|
||||
d.Width = 0.5f;
|
||||
});
|
||||
|
||||
protected virtual OsuDropdown<TItem> CreateDropdown() => new OsuDropdown<TItem>();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user