diff --git a/osu.Game/Overlays/NewsOverlay.cs b/osu.Game/Overlays/NewsOverlay.cs index 280e224255..b082614a6e 100644 --- a/osu.Game/Overlays/NewsOverlay.cs +++ b/osu.Game/Overlays/NewsOverlay.cs @@ -16,12 +16,11 @@ namespace osu.Game.Overlays { private readonly Bindable article = new Bindable(null); - protected override Container Content => content; - - private readonly Container content; private readonly Container sidebarContainer; private readonly NewsSidebar sidebar; + private readonly Container content; + private CancellationTokenSource cancellationToken; private bool displayUpdateRequired = true; @@ -29,7 +28,7 @@ namespace osu.Game.Overlays public NewsOverlay() : base(OverlayColourScheme.Purple, false) { - base.Content.Add(new GridContainer + Child = new GridContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, @@ -58,7 +57,7 @@ namespace osu.Game.Overlays } } } - }); + }; } protected override void LoadComplete() @@ -112,16 +111,12 @@ namespace osu.Game.Overlays protected void LoadDisplay(Drawable display) { ScrollFlow.ScrollToStart(); - LoadComponentAsync(display, loaded => - { - Child = loaded; - }, (cancellationToken = new CancellationTokenSource()).Token); + LoadComponentAsync(display, loaded => content.Child = loaded, (cancellationToken = new CancellationTokenSource()).Token); } protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); - sidebarContainer.Height = DrawHeight; sidebarContainer.Y = Math.Clamp(ScrollFlow.Current - Header.DrawHeight, 0, Math.Max(ScrollFlow.ScrollContent.DrawHeight - DrawHeight - Header.DrawHeight, 0)); }