From 5748b60a069f4e378c0028b7a46f5dcd12afde47 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Mon, 30 Dec 2019 08:26:49 +0300 Subject: [PATCH] Make item chevron size virtual --- osu.Game/Graphics/UserInterface/BreadcrumbControl.cs | 10 +++++----- osu.Game/Overlays/OverlayHeaderBreadcrumbControl.cs | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs index 6014840a45..d4705c539a 100644 --- a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs +++ b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs @@ -15,18 +15,18 @@ namespace osu.Game.Graphics.UserInterface public class BreadcrumbControl : OsuTabControl { private const float padding = 10; - private readonly float itemChevronSize; - protected override TabItem CreateTabItem(T value) => new BreadcrumbTabItem(value, itemChevronSize) + protected virtual float ItemChevronSize => 10; + + protected override TabItem 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 => diff --git a/osu.Game/Overlays/OverlayHeaderBreadcrumbControl.cs b/osu.Game/Overlays/OverlayHeaderBreadcrumbControl.cs index d772aa0d46..eee43ec229 100644 --- a/osu.Game/Overlays/OverlayHeaderBreadcrumbControl.cs +++ b/osu.Game/Overlays/OverlayHeaderBreadcrumbControl.cs @@ -9,15 +9,14 @@ namespace osu.Game.Overlays { public class OverlayHeaderBreadcrumbControl : BreadcrumbControl { - private const float item_chevron_size = 8; - public OverlayHeaderBreadcrumbControl() - : base(item_chevron_size) { RelativeSizeAxes = Axes.X; } - protected override TabItem CreateTabItem(string value) => new ControlTabItem(value, item_chevron_size); + protected override float ItemChevronSize => 8; + + protected override TabItem CreateTabItem(string value) => new ControlTabItem(value, ItemChevronSize); private class ControlTabItem : BreadcrumbTabItem {