1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 19:23:20 +08:00

Add padding to so the back button is not in the way

This commit is contained in:
Shivam 2020-05-16 04:05:01 +02:00
parent bf6ce390ff
commit b1243d6a87

View File

@ -44,6 +44,18 @@ namespace osu.Game.Tournament.Screens.Editors
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
BackButton.Receptor receptor = new BackButton.Receptor();
backButton = new BackButton(receptor)
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Action = () =>
{
if (IsSubScreen)
backAction.Invoke();
}
};
AddRangeInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
new Box new Box
@ -56,6 +68,7 @@ namespace osu.Game.Tournament.Screens.Editors
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Padding = new MarginPadding { Bottom = backButton.Height },
Child = flow = new FillFlowContainer<TDrawable> Child = flow = new FillFlowContainer<TDrawable>
{ {
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
@ -64,6 +77,7 @@ namespace osu.Game.Tournament.Screens.Editors
Spacing = new Vector2(20) Spacing = new Vector2(20)
}, },
}, },
backButton,
ControlPanel = new ControlPanel ControlPanel = new ControlPanel
{ {
Children = new Drawable[] Children = new Drawable[]
@ -85,17 +99,7 @@ namespace osu.Game.Tournament.Screens.Editors
}); });
if (IsSubScreen) if (IsSubScreen)
{
BackButton.Receptor receptor = new BackButton.Receptor();
backButton = new BackButton(receptor)
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Action = () => { backAction.Invoke(); }
};
AddInternal(backButton);
backButton.Show(); backButton.Show();
}
Storage.CollectionChanged += (_, args) => Storage.CollectionChanged += (_, args) =>
{ {