Refactor into some kind of sanity

This commit is contained in:
Dean Herbert
2020-01-03 15:01:42 +09:00
parent b80c421a29
commit e8567414c6
8 changed files with 86 additions and 100 deletions

View File

@ -24,9 +24,9 @@ namespace osu.Game.Overlays.News
public NewsHeader()
{
TabControl.AddItem(front_page_string);
BreadcrumbControl.AddItem(front_page_string);
TabControl.Current.ValueChanged += e =>
BreadcrumbControl.Current.ValueChanged += e =>
{
if (e.NewValue == front_page_string)
ShowFrontPage?.Invoke();
@ -38,7 +38,7 @@ namespace osu.Game.Overlays.News
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
TabControl.AccentColour = colours.Violet;
BreadcrumbControl.AccentColour = colours.Violet;
TitleBackgroundColour = colours.GreyVioletDarker;
ControlBackgroundColour = colours.GreyVioletDark;
}
@ -46,18 +46,18 @@ namespace osu.Game.Overlays.News
private void showPost(ValueChangedEvent<string> e)
{
if (e.OldValue != null)
TabControl.RemoveItem(e.OldValue);
BreadcrumbControl.RemoveItem(e.OldValue);
if (e.NewValue != null)
{
TabControl.AddItem(e.NewValue);
TabControl.Current.Value = e.NewValue;
BreadcrumbControl.AddItem(e.NewValue);
BreadcrumbControl.Current.Value = e.NewValue;
title.IsReadingPost = true;
}
else
{
TabControl.Current.Value = front_page_string;
BreadcrumbControl.Current.Value = front_page_string;
title.IsReadingPost = false;
}
}