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

Apply review suggestions

This commit is contained in:
Lucas A 2019-12-14 11:40:59 +01:00
parent 43720fbf45
commit 0a278ef943
3 changed files with 7 additions and 9 deletions

View File

@ -27,7 +27,7 @@ namespace osu.Game.Tests.Visual.Online
private class TestNewsOverlay : NewsOverlay private class TestNewsOverlay : NewsOverlay
{ {
public new void LoadAndShowChild(NewsContent content) => base.LoadAndShowChild(content); public new void LoadAndShowChild(NewsContent content) => base.LoadAndShowContent(content);
} }
private class NewsCoverTest : NewsContent private class NewsCoverTest : NewsContent

View File

@ -90,7 +90,6 @@ namespace osu.Game.Overlays.News
bg.OnLoadComplete += d => d.FadeIn(250, Easing.In); bg.OnLoadComplete += d => d.FadeIn(250, Easing.In);
} }
//news article cover background
[LongRunningLoad] [LongRunningLoad]
private class NewsBackground : Sprite private class NewsBackground : Sprite
{ {
@ -108,7 +107,6 @@ namespace osu.Game.Overlays.News
} }
} }
//date container
private class DateContainer : Container, IHasTooltip private class DateContainer : Container, IHasTooltip
{ {
private readonly DateTime date; private readonly DateTime date;
@ -134,7 +132,7 @@ namespace osu.Game.Overlays.News
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Font = OsuFont.GetFont(Typeface.Exo, 12, FontWeight.Black, false, false), Font = OsuFont.GetFont(Typeface.Exo, 12, FontWeight.Black, false, false),
Text = date.ToString("dd MMM yyy"), Text = date.ToString("d MMM yyy").ToUpper(),
Margin = new MarginPadding Margin = new MarginPadding
{ {
Vertical = 4, Vertical = 4,
@ -144,7 +142,7 @@ namespace osu.Game.Overlays.News
}; };
} }
public string TooltipText => date.ToString("dddd dd MMMM yyyy hh:mm:ss UTCz"); public string TooltipText => date.ToString("dddd dd MMMM yyyy hh:mm:ss UTCz").ToUpper();
} }
//fake API data struct to use for now as a skeleton for data, as there is no API struct for news article info for now //fake API data struct to use for now as a skeleton for data, as there is no API struct for news article info for now

View File

@ -59,19 +59,19 @@ namespace osu.Game.Overlays
Current.TriggerChange(); Current.TriggerChange();
} }
private CancellationTokenSource loadChildCancellation; private CancellationTokenSource loadContentCancellation;
protected void LoadAndShowChild(NewsContent newContent) protected void LoadAndShowContent(NewsContent newContent)
{ {
content.FadeTo(0.2f, 300, Easing.OutQuint); content.FadeTo(0.2f, 300, Easing.OutQuint);
loadChildCancellation?.Cancel(); loadContentCancellation?.Cancel();
LoadComponentAsync(newContent, c => LoadComponentAsync(newContent, c =>
{ {
content.Child = c; content.Child = c;
content.FadeIn(300, Easing.OutQuint); content.FadeIn(300, Easing.OutQuint);
}, (loadChildCancellation = new CancellationTokenSource()).Token); }, (loadContentCancellation = new CancellationTokenSource()).Token);
} }
public void ShowFrontPage() public void ShowFrontPage()