1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Remove unnecessary container

This commit is contained in:
Dean Herbert 2019-09-13 16:25:25 +09:00
parent 7818ecd71c
commit 78e7be919f

View File

@ -22,7 +22,6 @@ namespace osu.Game.Overlays.Rankings
public readonly Bindable<Country> Country = new Bindable<Country>(); public readonly Bindable<Country> Country = new Bindable<Country>();
private readonly SpriteText scopeText; private readonly SpriteText scopeText;
private readonly Container flagPlaceholder;
private readonly DismissableFlag flag; private readonly DismissableFlag flag;
public HeaderTitle() public HeaderTitle()
@ -35,17 +34,13 @@ namespace osu.Game.Overlays.Rankings
Spacing = new Vector2(spacing, 0), Spacing = new Vector2(spacing, 0),
Children = new Drawable[] Children = new Drawable[]
{ {
flagPlaceholder = new Container flag = new DismissableFlag
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Bottom = flag_margin }, Margin = new MarginPadding { Bottom = flag_margin },
Child = flag = new DismissableFlag
{
Size = new Vector2(30, 20), Size = new Vector2(30, 20),
}, },
},
scopeText = new SpriteText scopeText = new SpriteText
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
@ -90,15 +85,13 @@ namespace osu.Game.Overlays.Rankings
{ {
if (country.NewValue == null) if (country.NewValue == null)
{ {
flagPlaceholder.Hide(); flag.Hide();
return; return;
} }
Scope.Value = RankingsScope.Performance; Scope.Value = RankingsScope.Performance;
if (country.OldValue == null) flag.Show();
flagPlaceholder.Show();
flag.Country = country.NewValue; flag.Country = country.NewValue;
} }
} }