1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Allow null for breadcrumb control

This commit is contained in:
bdach 2021-07-17 20:33:26 +08:00 committed by kj415j45
parent e3c10e3994
commit 7859d02c5b
2 changed files with 7 additions and 7 deletions

View File

@ -9,11 +9,11 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays
{
public abstract class BreadcrumbControlOverlayHeader : TabControlOverlayHeader<LocalisableString>
public abstract class BreadcrumbControlOverlayHeader : TabControlOverlayHeader<LocalisableString?>
{
protected override OsuTabControl<LocalisableString> CreateTabControl() => new OverlayHeaderBreadcrumbControl();
protected override OsuTabControl<LocalisableString?> CreateTabControl() => new OverlayHeaderBreadcrumbControl();
public class OverlayHeaderBreadcrumbControl : BreadcrumbControl<LocalisableString>
public class OverlayHeaderBreadcrumbControl : BreadcrumbControl<LocalisableString?>
{
public OverlayHeaderBreadcrumbControl()
{
@ -27,7 +27,7 @@ namespace osu.Game.Overlays
AccentColour = colourProvider.Light2;
}
protected override TabItem<LocalisableString> CreateTabItem(LocalisableString value) => new ControlTabItem(value)
protected override TabItem<LocalisableString?> CreateTabItem(LocalisableString? value) => new ControlTabItem(value)
{
AccentColour = AccentColour,
};
@ -36,7 +36,7 @@ namespace osu.Game.Overlays
{
protected override float ChevronSize => 8;
public ControlTabItem(LocalisableString value)
public ControlTabItem(LocalisableString? value)
: base(value)
{
RelativeSizeAxes = Axes.Y;

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Wiki
return;
TabControl.Clear();
Current.Value = string.Empty;
Current.Value = null;
TabControl.AddItem(index_page_string);
@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Wiki
Current.Value = e.NewValue.Title;
}
private void onCurrentChange(ValueChangedEvent<LocalisableString> e)
private void onCurrentChange(ValueChangedEvent<LocalisableString?> e)
{
if (e.NewValue == TabControl.Items.LastOrDefault())
return;