mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +08:00
Update with generic labelledcomponent
This commit is contained in:
parent
5212c50654
commit
6b702eb6de
@ -7,6 +7,7 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Edit.Setup.Components.LabelledComponents;
|
using osu.Game.Screens.Edit.Setup.Components.LabelledComponents;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.UserInterface
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
@ -27,7 +28,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
AddStep("create component", () =>
|
AddStep("create component", () =>
|
||||||
{
|
{
|
||||||
LabelledComponent component;
|
LabelledComponent<OsuTextBox> component;
|
||||||
|
|
||||||
Child = new Container
|
Child = new Container
|
||||||
{
|
{
|
||||||
|
@ -9,12 +9,10 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
|
namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
|
||||||
{
|
{
|
||||||
public class LabelledTextBox : LabelledComponent
|
public class LabelledTextBox : LabelledComponent<OsuTextBox>
|
||||||
{
|
{
|
||||||
public event TextBox.OnCommitHandler OnCommit;
|
public event TextBox.OnCommitHandler OnCommit;
|
||||||
|
|
||||||
protected new OsuTextBox Component => (OsuTextBox)base.Component;
|
|
||||||
|
|
||||||
public LabelledTextBox()
|
public LabelledTextBox()
|
||||||
: base(false)
|
: base(false)
|
||||||
{
|
{
|
||||||
@ -41,7 +39,7 @@ namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
|
|||||||
Component.BorderColour = colours.Blue;
|
Component.BorderColour = colours.Blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateComponent() => new OsuTextBox
|
protected override OsuTextBox CreateComponent() => new OsuTextBox
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
Loading…
Reference in New Issue
Block a user