1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Fix header potentially overflowing the dialog

This commit is contained in:
smoogipoo 2018-11-23 15:18:40 +09:00
parent 376e76e00d
commit ac73844fe0

View File

@ -7,12 +7,10 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Input.Bindings;
using OpenTK;
using OpenTK.Graphics;
@ -35,7 +33,7 @@ namespace osu.Game.Overlays.Dialog
private readonly Container ring;
private readonly FillFlowContainer<PopupDialogButton> buttonsContainer;
private readonly SpriteIcon icon;
private readonly SpriteText header;
private readonly TextFlowContainer header;
private readonly TextFlowContainer body;
private bool actionInvoked;
@ -46,10 +44,19 @@ namespace osu.Game.Overlays.Dialog
set => icon.Icon = value;
}
private string text;
public string HeaderText
{
get => header.Text;
set => header.Text = value;
get => text;
set
{
if (text == value)
return;
text = value;
header.Text = value;
}
}
public string BodyText
@ -164,18 +171,20 @@ namespace osu.Game.Overlays.Dialog
},
},
},
header = new OsuSpriteText
header = new OsuTextFlowContainer(t => t.TextSize = 25)
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
TextSize = 25,
Shadow = true,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding(15),
TextAnchor = Anchor.TopCentre,
},
body = new OsuTextFlowContainer(t => t.TextSize = 18)
{
Padding = new MarginPadding(15),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding(15),
TextAnchor = Anchor.TopCentre,
},
},