mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Implement CancellableCommentEditor
This commit is contained in:
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Comments;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
@ -16,6 +17,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(CommentEditor),
|
||||
typeof(CancellableCommentEditor),
|
||||
};
|
||||
|
||||
[Cached]
|
||||
@ -23,13 +25,19 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
public TestSceneCommentEditor()
|
||||
{
|
||||
Add(new Container
|
||||
Add(new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Width = 800,
|
||||
Child = new TestCommentEditor()
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 20),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new TestCommentEditor(),
|
||||
new TestCancellableCommentEditor()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -41,5 +49,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
protected override string TextboxPlaceholderText => @"This textbox is empty";
|
||||
}
|
||||
|
||||
private class TestCancellableCommentEditor : CancellableCommentEditor
|
||||
{
|
||||
protected override string FooterText => @"Wow, another one. Sicc";
|
||||
|
||||
protected override string CommitButtonText => @"Save";
|
||||
|
||||
protected override string TextboxPlaceholderText => @"Miltiline textboxes soon";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user