1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 14:07:25 +08:00
osu-lazer/osu.Game/Graphics/UserInterfaceV2/LabelledDropdown.cs

34 lines
934 B
C#
Raw Normal View History

// 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.
2022-06-17 15:37:17 +08:00
#nullable disable
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterfaceV2
{
2022-11-24 13:32:20 +08:00
public partial 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>();
}
}