From 17f2baf600fd703a1f6769bbc08c9298019eb07a Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 4 Mar 2020 00:35:32 +0300 Subject: [PATCH] Remove GetWidth function --- .../Changelog/ChangelogUpdateStreamItem.cs | 10 ++-------- osu.Game/Overlays/OverlayUpdateStreamItem.cs | 14 ++++---------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/osu.Game/Overlays/Changelog/ChangelogUpdateStreamItem.cs b/osu.Game/Overlays/Changelog/ChangelogUpdateStreamItem.cs index 189c156b35..5a16fc8ddf 100644 --- a/osu.Game/Overlays/Changelog/ChangelogUpdateStreamItem.cs +++ b/osu.Game/Overlays/Changelog/ChangelogUpdateStreamItem.cs @@ -13,14 +13,8 @@ namespace osu.Game.Overlays.Changelog public ChangelogUpdateStreamItem(APIUpdateStream stream) : base(stream) { - } - - protected override float GetWidth() - { - if (Value.IsFeatured) - return base.GetWidth() * 2; - - return base.GetWidth(); + if (stream.IsFeatured) + Width *= 2; } protected override string GetMainText() => Value.DisplayName; diff --git a/osu.Game/Overlays/OverlayUpdateStreamItem.cs b/osu.Game/Overlays/OverlayUpdateStreamItem.cs index ce9aca6f1f..0cdf894f73 100644 --- a/osu.Game/Overlays/OverlayUpdateStreamItem.cs +++ b/osu.Game/Overlays/OverlayUpdateStreamItem.cs @@ -11,16 +11,12 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Allocation; using osu.Game.Graphics.Sprites; using osu.Game.Graphics; -using osuTK; using osuTK.Graphics; namespace osu.Game.Overlays { public abstract class OverlayUpdateStreamItem : TabItem { - private const float transition_duration = 100; - private const float tab_width = 100; - public readonly Bindable SelectedItem = new Bindable(); private bool userHoveringArea; @@ -43,14 +39,14 @@ namespace osu.Game.Overlays protected OverlayUpdateStreamItem(T value) : base(value) { + Height = 60; + Width = 100; + Padding = new MarginPadding(5); } [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider, OsuColour colours) { - Size = new Vector2(GetWidth(), 60); - Padding = new MarginPadding(5); - AddRange(new Drawable[] { text = new FillFlowContainer @@ -100,8 +96,6 @@ namespace osu.Game.Overlays protected abstract Color4 GetBarColour(OsuColour colours); - protected virtual float GetWidth() => tab_width; - protected override void OnActivated() => updateState(); protected override void OnDeactivated() => updateState(); @@ -140,7 +134,7 @@ namespace osu.Game.Overlays } expandingBar.Expanded = barExpanded; - text.FadeTo(textHighlighted ? 1 : 0.5f, transition_duration, Easing.OutQuint); + text.FadeTo(textHighlighted ? 1 : 0.5f, 100, Easing.OutQuint); } } }