1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 09:27:34 +08:00

Rename all DropDown -> Dropdown.

This commit is contained in:
Huo Yaoyuan 2017-03-22 22:32:32 +08:00
parent 6a4ca08578
commit 0dbc232ebf
15 changed files with 41 additions and 41 deletions

View File

@ -8,9 +8,9 @@ using osu.Framework.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterface
{
public class OsuDropDown<T> : DropDown<T>
public class OsuDropdown<T> : Dropdown<T>
{
protected override DropDownHeader CreateHeader() => new OsuDropDownHeader { AccentColour = AccentColour };
protected override DropdownHeader CreateHeader() => new OsuDropdownHeader { AccentColour = AccentColour };
protected override Menu CreateMenu() => new OsuMenu();
@ -22,8 +22,8 @@ namespace osu.Game.Graphics.UserInterface
{
accentColour = value;
if (Header != null)
((OsuDropDownHeader)Header).AccentColour = value;
foreach (var item in MenuItems.OfType<OsuDropDownMenuItem<T>>())
((OsuDropdownHeader)Header).AccentColour = value;
foreach (var item in MenuItems.OfType<OsuDropdownMenuItem<T>>())
item.AccentColour = value;
}
}
@ -35,6 +35,6 @@ namespace osu.Game.Graphics.UserInterface
AccentColour = colours.PinkDarker;
}
protected override DropDownMenuItem<T> CreateMenuItem(string text, T value) => new OsuDropDownMenuItem<T>(text, value) { AccentColour = AccentColour };
protected override DropdownMenuItem<T> CreateMenuItem(string text, T value) => new OsuDropdownMenuItem<T>(text, value) { AccentColour = AccentColour };
}
}

View File

@ -12,7 +12,7 @@ using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Graphics.UserInterface
{
public class OsuDropDownHeader : DropDownHeader
public class OsuDropdownHeader : DropdownHeader
{
private SpriteText label;
protected override string Label
@ -32,7 +32,7 @@ namespace osu.Game.Graphics.UserInterface
}
}
public OsuDropDownHeader()
public OsuDropdownHeader()
{
Foreground.Padding = new MarginPadding(4);

View File

@ -12,9 +12,9 @@ using OpenTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
public class OsuDropDownMenuItem<U> : DropDownMenuItem<U>
public class OsuDropdownMenuItem<T> : DropdownMenuItem<T>
{
public OsuDropDownMenuItem(string text, U value) : base(text, value)
public OsuDropdownMenuItem(string text, T value) : base(text, value)
{
Foreground.Padding = new MarginPadding(2);

View File

@ -16,11 +16,11 @@ namespace osu.Game.Graphics.UserInterface
{
public class OsuTabControl<T> : TabControl<T>
{
protected override DropDown<T> CreateDropDown() => new OsuTabDropDown();
protected override Dropdown<T> CreateDropdown() => new OsuTabDropdown();
protected override TabItem<T> CreateTabItem(T value) => new OsuTabItem<T> { Value = value };
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || DropDown.Contains(screenSpacePos);
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown.Contains(screenSpacePos);
public OsuTabControl()
{
@ -45,7 +45,7 @@ namespace osu.Game.Graphics.UserInterface
set
{
accentColour = value;
var dropDown = DropDown as OsuTabDropDown;
var dropDown = Dropdown as OsuTabDropdown;
if (dropDown != null)
dropDown.AccentColour = value;
foreach (var item in TabContainer.Children.OfType<OsuTabItem<T>>())
@ -53,34 +53,34 @@ namespace osu.Game.Graphics.UserInterface
}
}
public class OsuTabDropDown : OsuDropDown<T>
public class OsuTabDropdown : OsuDropdown<T>
{
protected override DropDownHeader CreateHeader() => new OsuTabDropDownHeader
protected override DropdownHeader CreateHeader() => new OsuTabDropdownHeader
{
AccentColour = AccentColour,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
};
protected override DropDownMenuItem<T> CreateMenuItem(string text, T value)
protected override DropdownMenuItem<T> CreateMenuItem(string text, T value)
{
var item = base.CreateMenuItem(text, value);
item.ForegroundColourHover = Color4.Black;
return item;
}
public OsuTabDropDown()
public OsuTabDropdown()
{
DropDownMenu.Anchor = Anchor.TopRight;
DropDownMenu.Origin = Anchor.TopRight;
DropdownMenu.Anchor = Anchor.TopRight;
DropdownMenu.Origin = Anchor.TopRight;
RelativeSizeAxes = Axes.X;
DropDownMenu.Background.Colour = Color4.Black.Opacity(0.7f);
DropDownMenu.MaxHeight = 400;
DropdownMenu.Background.Colour = Color4.Black.Opacity(0.7f);
DropdownMenu.MaxHeight = 400;
}
public class OsuTabDropDownHeader : OsuDropDownHeader
public class OsuTabDropdownHeader : OsuDropdownHeader
{
public override Color4 AccentColour
{
@ -104,7 +104,7 @@ namespace osu.Game.Graphics.UserInterface
base.OnHoverLost(state);
}
public OsuTabDropDownHeader()
public OsuTabDropdownHeader()
{
RelativeSizeAxes = Axes.None;
AutoSizeAxes = Axes.X;

View File

@ -13,9 +13,9 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options
{
public class OptionDropDown<T> : FillFlowContainer
public class OptionDropdown<T> : FillFlowContainer
{
private DropDown<T> dropdown;
private Dropdown<T> dropdown;
private SpriteText text;
public string LabelText
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Options
}
}
public OptionDropDown()
public OptionDropdown()
{
Items = new KeyValuePair<string, T>[0];
@ -68,7 +68,7 @@ namespace osu.Game.Overlays.Options
text = new OsuSpriteText {
Alpha = 0,
},
dropdown = new OsuDropDown<T>
dropdown = new OsuDropdown<T>
{
Margin = new MarginPadding { Top = 5 },
RelativeSizeAxes = Axes.X,

View File

@ -8,9 +8,9 @@ using System.Collections.Generic;
namespace osu.Game.Overlays.Options
{
public class OptionEnumDropDown<T> : OptionDropDown<T>
public class OptionEnumDropdown<T> : OptionDropdown<T>
{
public OptionEnumDropDown()
public OptionEnumDropdown()
{
if (!typeof(T).IsEnum)
throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument");

View File

@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
protected override string Header => "Devices";
private AudioManager audio;
private OptionDropDown<string> dropdown;
private OptionDropdown<string> dropdown;
[BackgroundDependencyLoader]
private void load(AudioManager audio)
@ -50,7 +50,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
Children = new Drawable[]
{
dropdown = new OptionDropDown<string>
dropdown = new OptionDropdown<string>
{
Bindable = audio.AudioDevice
},

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections.Debug
{
Children = new Drawable[]
{
new OptionEnumDropDown<GCLatencyMode>
new OptionEnumDropdown<GCLatencyMode>
{
LabelText = "Active mode",
Bindable = config.GetBindable<GCLatencyMode>(FrameworkDebugConfig.ActiveGCMode)

View File

@ -23,12 +23,12 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay
LabelText = "Background dim",
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.DimLevel)
},
new OptionEnumDropDown<ProgressBarType>
new OptionEnumDropdown<ProgressBarType>
{
LabelText = "Progress display",
Bindable = config.GetBindable<ProgressBarType>(OsuConfig.ProgressBarType)
},
new OptionEnumDropDown<ScoreMeterType>
new OptionEnumDropdown<ScoreMeterType>
{
LabelText = "Score meter type",
Bindable = config.GetBindable<ScoreMeterType>(OsuConfig.ScoreMeter)

View File

@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Options.Sections.General
{
Children = new Drawable[]
{
new OptionEnumDropDown<ReleaseStream>
new OptionEnumDropdown<ReleaseStream>
{
LabelText = "Release stream",
Bindable = config.GetBindable<ReleaseStream>(OsuConfig.ReleaseStream),

View File

@ -57,7 +57,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
LabelText = "Softening filter",
Bindable = config.GetBindable<bool>(OsuConfig.BloomSoftening)
},
new OptionEnumDropDown<ScreenshotFormat>
new OptionEnumDropdown<ScreenshotFormat>
{
LabelText = "Screenshot",
Bindable = config.GetBindable<ScreenshotFormat>(OsuConfig.ScreenshotFormat)

View File

@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
Children = new Drawable[]
{
new OptionLabel { Text = "Resolution: TODO dropdown" },
new OptionEnumDropDown<WindowMode>
new OptionEnumDropdown<WindowMode>
{
LabelText = "Screen mode",
Bindable = config.GetBindable<WindowMode>(FrameworkConfig.WindowMode),

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
Children = new Drawable[]
{
// TODO: this needs to be a custom dropdown at some point
new OptionEnumDropDown<FrameSync>
new OptionEnumDropdown<FrameSync>
{
LabelText = "Frame limiter",
Bindable = config.GetBindable<FrameSync>(FrameworkConfig.FrameSync)

View File

@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Options.Sections.Input
LabelText = "Map absolute raw input to the osu! window",
Bindable = config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow)
},
new OptionEnumDropDown<ConfineMouseMode>
new OptionEnumDropdown<ConfineMouseMode>
{
LabelText = "Confine mouse cursor",
Bindable = config.GetBindable<ConfineMouseMode>(OsuConfig.ConfineMouse),

View File

@ -161,9 +161,9 @@
<Compile Include="Overlays\Notifications\SimpleNotification.cs" />
<Compile Include="Overlays\Options\OptionDropDown.cs" />
<Compile Include="Overlays\Options\OptionLabel.cs" />
<Compile Include="Graphics\UserInterface\OsuDropDownHeader.cs" />
<Compile Include="Graphics\UserInterface\OsuDropDown.cs" />
<Compile Include="Graphics\UserInterface\OsuDropDownMenuItem.cs" />
<Compile Include="Graphics\UserInterface\OsuDropdownHeader.cs" />
<Compile Include="Graphics\UserInterface\OsuDropdown.cs" />
<Compile Include="Graphics\UserInterface\OsuDropdownMenuItem.cs" />
<Compile Include="Overlays\Options\OptionsFooter.cs" />
<Compile Include="Overlays\Options\Sections\DebugSection.cs" />
<Compile Include="Overlays\Options\Sections\Debug\GeneralOptions.cs" />