1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 03:42:55 +08:00

Make PopupDialog abstract

This commit is contained in:
Dean Herbert 2019-09-13 15:27:29 +09:00
parent e2e87d5268
commit 44947aa9ed
3 changed files with 22 additions and 11 deletions

View File

@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Add(overlay = new DialogOverlay()); Add(overlay = new DialogOverlay());
AddStep("dialog #1", () => overlay.Push(new PopupDialog AddStep("dialog #1", () => overlay.Push(new TestPopupDialog
{ {
Icon = FontAwesome.Regular.TrashAlt, Icon = FontAwesome.Regular.TrashAlt,
HeaderText = @"Confirm deletion of", HeaderText = @"Confirm deletion of",
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual.UserInterface
}, },
})); }));
AddStep("dialog #2", () => overlay.Push(new PopupDialog AddStep("dialog #2", () => overlay.Push(new TestPopupDialog
{ {
Icon = FontAwesome.Solid.Cog, Icon = FontAwesome.Solid.Cog,
HeaderText = @"What do you want to do with", HeaderText = @"What do you want to do with",
@ -71,5 +71,9 @@ namespace osu.Game.Tests.Visual.UserInterface
}, },
})); }));
} }
private class TestPopupDialog : PopupDialog
{
}
} }
} }

View File

@ -13,13 +13,22 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
public TestScenePopupDialog() public TestScenePopupDialog()
{ {
var popup = new PopupDialog Add(new TestPopupDialog
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
State = { Value = Framework.Graphics.Containers.Visibility.Visible }, State = { Value = Framework.Graphics.Containers.Visibility.Visible },
Icon = FontAwesome.Solid.AssistiveListeningSystems, });
HeaderText = @"This is a test popup", }
BodyText = "I can say lots of stuff and even wrap my words!",
private class TestPopupDialog : PopupDialog
{
public TestPopupDialog()
{
Icon = FontAwesome.Solid.AssistiveListeningSystems;
HeaderText = @"This is a test popup";
BodyText = "I can say lots of stuff and even wrap my words!";
Buttons = new PopupDialogButton[] Buttons = new PopupDialogButton[]
{ {
new PopupDialogCancelButton new PopupDialogCancelButton
@ -30,10 +39,8 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
Text = @"You're a fake!", Text = @"You're a fake!",
}, },
}
}; };
}
Add(popup);
} }
} }
} }

View File

@ -19,7 +19,7 @@ using osuTK.Input;
namespace osu.Game.Overlays.Dialog namespace osu.Game.Overlays.Dialog
{ {
public class PopupDialog : VisibilityContainer public abstract class PopupDialog : VisibilityContainer
{ {
public static readonly float ENTER_DURATION = 500; public static readonly float ENTER_DURATION = 500;
public static readonly float EXIT_DURATION = 200; public static readonly float EXIT_DURATION = 200;