mirror of
https://github.com/ppy/osu
synced 2025-01-24 06:43:04 +00:00
Make item chevron size virtual
This commit is contained in:
parent
9d5d61a64d
commit
5748b60a06
@ -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 =>
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user