Refactor OverlayHeader hierarchy

This commit is contained in:
Andrei Zavatski
2020-01-21 06:00:12 +03:00
parent 178a72f9b8
commit 30edd80c8c
8 changed files with 67 additions and 97 deletions

View File

@ -28,8 +28,8 @@ namespace osu.Game.Overlays.Changelog
public ChangelogHeader()
: base(OverlayColourScheme.Purple)
{
BreadcrumbControl.AddItem(listing_string);
BreadcrumbControl.Current.ValueChanged += e =>
TabControl.AddItem(listing_string);
TabControl.Current.ValueChanged += e =>
{
if (e.NewValue == listing_string)
ListingSelected?.Invoke();
@ -49,12 +49,12 @@ namespace osu.Game.Overlays.Changelog
private void showBuild(ValueChangedEvent<APIChangelogBuild> e)
{
if (e.OldValue != null)
BreadcrumbControl.RemoveItem(e.OldValue.ToString());
TabControl.RemoveItem(e.OldValue.ToString());
if (e.NewValue != null)
{
BreadcrumbControl.AddItem(e.NewValue.ToString());
BreadcrumbControl.Current.Value = e.NewValue.ToString();
TabControl.AddItem(e.NewValue.ToString());
TabControl.Current.Value = e.NewValue.ToString();
Streams.Current.Value = Streams.Items.FirstOrDefault(s => s.Name == e.NewValue.UpdateStream.Name);
@ -62,7 +62,7 @@ namespace osu.Game.Overlays.Changelog
}
else
{
BreadcrumbControl.Current.Value = listing_string;
TabControl.Current.Value = listing_string;
Streams.Current.Value = null;
title.Version = null;
}