mirror of
https://github.com/ppy/osu.git
synced 2025-03-18 06:27:18 +08:00
Add labelled dropdown component
This commit is contained in:
parent
97075c49e9
commit
fced262c41
29
osu.Game/Graphics/UserInterfaceV2/LabelledDropdown.cs
Normal file
29
osu.Game/Graphics/UserInterfaceV2/LabelledDropdown.cs
Normal file
@ -0,0 +1,29 @@
|
||||
// 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<T> : LabelledComponent<OsuDropdown<T>, T>
|
||||
{
|
||||
public LabelledDropdown()
|
||||
: base(true)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<T> Items
|
||||
{
|
||||
get => Component.Items;
|
||||
set => Component.Items = value;
|
||||
}
|
||||
|
||||
protected override OsuDropdown<T> CreateComponent() => new OsuDropdown<T>
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Width = 0.5f,
|
||||
};
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user