1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 13:22:55 +08:00

Updated usage for DropDownHeader of FilterTabControl

This commit is contained in:
Kelvin 2017-03-09 02:50:00 -08:00
parent 40bcc63a90
commit ee3d3b682f
3 changed files with 9 additions and 6 deletions

View File

@ -11,7 +11,7 @@ namespace osu.Game.Graphics.UserInterface
{
public class OsuDropDownMenu<U> : DropDownMenu<U>
{
protected override BasicDropDownHeader CreateHeader() => new OsuDropDownHeader();
protected override DropDownHeader CreateHeader() => new OsuDropDownHeader();
public OsuDropDownMenu()
{

View File

@ -8,16 +8,19 @@ using osu.Game.Graphics;
namespace osu.Game.Screens.Select.Tab
{
public class FilterTabDropDownHeader : BasicDropDownHeader
public class FilterTabDropDownHeader : DropDownHeader
{
protected override string Label { get; set; }
private TextAwesome ellipses;
public FilterTabDropDownHeader()
{
public FilterTabDropDownHeader() {
Background.Hide(); // don't need a background
RelativeSizeAxes = Axes.None;
AutoSizeAxes = Axes.Both;
Children = new Drawable[]
Foreground.RelativeSizeAxes = Axes.None;
Foreground.AutoSizeAxes = Axes.Both;
Foreground.Children = new Drawable[]
{
ellipses = new TextAwesome
{

View File

@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select.Tab
public override float HeaderWidth => 14;
public override float HeaderHeight => 24;
protected override BasicDropDownHeader CreateHeader() => new FilterTabDropDownHeader();
protected override DropDownHeader CreateHeader() => new FilterTabDropDownHeader();
protected override IEnumerable<DropDownMenuItem<T>> GetDropDownItems(IEnumerable<KeyValuePair<string, T>> values)
=> values.Select(v => new FilterTabDropDownMenuItem<T>(v.Key, v.Value));