Make item chevron size virtual

This commit is contained in:
Andrei Zavatski 2019-12-30 08:26:49 +03:00
parent 9d5d61a64d
commit 5748b60a06
2 changed files with 8 additions and 9 deletions

View File

@ -15,18 +15,18 @@ namespace osu.Game.Graphics.UserInterface
public class BreadcrumbControl<T> : OsuTabControl<T>
{
private const float padding = 10;
private readonly float itemChevronSize;
protected override TabItem<T> CreateTabItem(T value) => new BreadcrumbTabItem(value, itemChevronSize)
protected virtual float ItemChevronSize => 10;
protected override TabItem<T> CreateTabItem(T value) => new BreadcrumbTabItem(value, ItemChevronSize)
{
AccentColour = AccentColour,
};
protected override float StripWidth() => base.StripWidth() - (padding + itemChevronSize);
protected override float StripWidth() => base.StripWidth() - (padding + ItemChevronSize);
public BreadcrumbControl(float itemChevronSize = 10)
public BreadcrumbControl()
{
this.itemChevronSize = itemChevronSize;
Height = 32;
TabContainer.Spacing = new Vector2(padding, 0f);
Current.ValueChanged += index =>

View File

@ -9,15 +9,14 @@ namespace osu.Game.Overlays
{
public class OverlayHeaderBreadcrumbControl : BreadcrumbControl<string>
{
private const float item_chevron_size = 8;
public OverlayHeaderBreadcrumbControl()
: base(item_chevron_size)
{
RelativeSizeAxes = Axes.X;
}
protected override TabItem<string> CreateTabItem(string value) => new ControlTabItem(value, item_chevron_size);
protected override float ItemChevronSize => 8;
protected override TabItem<string> CreateTabItem(string value) => new ControlTabItem(value, ItemChevronSize);
private class ControlTabItem : BreadcrumbTabItem
{