// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsDropdown : SettingsItem { protected new OsuDropdown Control => (OsuDropdown)base.Control; private IEnumerable items = Enumerable.Empty(); public IEnumerable Items { get => items; set { items = value; if (Control != null) Control.Items = value; } } protected sealed override Drawable CreateControl() => CreateDropdown(); protected virtual OsuDropdown CreateDropdown() => new DropdownControl { Items = Items }; protected class DropdownControl : OsuDropdown { public DropdownControl() { Margin = new MarginPadding { Top = 5 }; RelativeSizeAxes = Axes.X; } } } }