Move background creation out from UpdateStreamBadgeArea

This commit is contained in:
Andrei Zavatski
2020-02-27 14:39:10 +03:00
parent 7c0e823b95
commit d92e93ed31
2 changed files with 15 additions and 10 deletions

View File

@ -4,9 +4,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
@ -22,6 +24,8 @@ namespace osu.Game.Overlays.Changelog
private const string listing_string = "listing"; private const string listing_string = "listing";
private Box streamsBackground;
public ChangelogHeader() public ChangelogHeader()
{ {
TabControl.AddItem(listing_string); TabControl.AddItem(listing_string);
@ -40,6 +44,12 @@ namespace osu.Game.Overlays.Changelog
}; };
} }
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
streamsBackground.Colour = colourProvider.Background5;
}
private ChangelogHeaderTitle title; private ChangelogHeaderTitle title;
private void showBuild(ValueChangedEvent<APIChangelogBuild> e) private void showBuild(ValueChangedEvent<APIChangelogBuild> e)
@ -72,6 +82,10 @@ namespace osu.Game.Overlays.Changelog
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Children = new Drawable[] Children = new Drawable[]
{ {
streamsBackground = new Box
{
RelativeSizeAxes = Axes.Both
},
Streams = new UpdateStreamBadgeArea(), Streams = new UpdateStreamBadgeArea(),
} }
}; };

View File

@ -6,25 +6,16 @@ using osu.Framework.Input.Events;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Allocation;
namespace osu.Game.Overlays.Changelog namespace osu.Game.Overlays.Changelog
{ {
public class UpdateStreamBadgeArea : TabControl<APIUpdateStream> public class UpdateStreamBadgeArea : TabControl<APIUpdateStream>
{ {
[BackgroundDependencyLoader] public UpdateStreamBadgeArea()
private void load(OverlayColourProvider colourProvider)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
AddInternal(new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5,
});
} }
public void Populate(List<APIUpdateStream> streams) public void Populate(List<APIUpdateStream> streams)