Fade only textContainer instead of entire MetadataSection

This commit is contained in:
HoLLy 2018-10-26 13:35:51 +02:00
parent 88aca46500
commit cf3b4447eb

View File

@ -307,10 +307,10 @@ namespace osu.Game.Screens.Select
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Alpha = 0;
InternalChild = textContainer = new FillFlowContainer InternalChild = textContainer = new FillFlowContainer
{ {
Alpha = 0,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(spacing / 2), Spacing = new Vector2(spacing / 2),
@ -337,17 +337,14 @@ namespace osu.Game.Screens.Select
{ {
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(value))
{ {
this.FadeOut(transition_duration); textContainer.FadeOut(transition_duration);
return; return;
} }
this.FadeIn(transition_duration);
setTextAsync(value); setTextAsync(value);
} }
} }
public override bool IsPresent => base.IsPresent || textFlow == null; // Visibility is updated in the LoadComponentAsync callback
private void setTextAsync(string text) private void setTextAsync(string text)
{ {
LoadComponentAsync(new OsuTextFlowContainer(s => s.TextSize = 14) LoadComponentAsync(new OsuTextFlowContainer(s => s.TextSize = 14)
@ -362,7 +359,7 @@ namespace osu.Game.Screens.Select
textContainer.Add(textFlow = loaded); textContainer.Add(textFlow = loaded);
// fade in if we haven't yet. // fade in if we haven't yet.
this.FadeIn(transition_duration); textContainer.FadeIn(transition_duration);
}); });
} }
} }