1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-13 02:27:20 +08:00

Remove GetWidth function

This commit is contained in:
Andrei Zavatski 2020-03-04 00:35:32 +03:00
parent 4d5445b5dc
commit 17f2baf600
2 changed files with 6 additions and 18 deletions

View File

@ -13,14 +13,8 @@ namespace osu.Game.Overlays.Changelog
public ChangelogUpdateStreamItem(APIUpdateStream stream) public ChangelogUpdateStreamItem(APIUpdateStream stream)
: base(stream) : base(stream)
{ {
} if (stream.IsFeatured)
Width *= 2;
protected override float GetWidth()
{
if (Value.IsFeatured)
return base.GetWidth() * 2;
return base.GetWidth();
} }
protected override string GetMainText() => Value.DisplayName; protected override string GetMainText() => Value.DisplayName;

View File

@ -11,16 +11,12 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
public abstract class OverlayUpdateStreamItem<T> : TabItem<T> public abstract class OverlayUpdateStreamItem<T> : TabItem<T>
{ {
private const float transition_duration = 100;
private const float tab_width = 100;
public readonly Bindable<T> SelectedItem = new Bindable<T>(); public readonly Bindable<T> SelectedItem = new Bindable<T>();
private bool userHoveringArea; private bool userHoveringArea;
@ -43,14 +39,14 @@ namespace osu.Game.Overlays
protected OverlayUpdateStreamItem(T value) protected OverlayUpdateStreamItem(T value)
: base(value) : base(value)
{ {
Height = 60;
Width = 100;
Padding = new MarginPadding(5);
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider, OsuColour colours) private void load(OverlayColourProvider colourProvider, OsuColour colours)
{ {
Size = new Vector2(GetWidth(), 60);
Padding = new MarginPadding(5);
AddRange(new Drawable[] AddRange(new Drawable[]
{ {
text = new FillFlowContainer<SpriteText> text = new FillFlowContainer<SpriteText>
@ -100,8 +96,6 @@ namespace osu.Game.Overlays
protected abstract Color4 GetBarColour(OsuColour colours); protected abstract Color4 GetBarColour(OsuColour colours);
protected virtual float GetWidth() => tab_width;
protected override void OnActivated() => updateState(); protected override void OnActivated() => updateState();
protected override void OnDeactivated() => updateState(); protected override void OnDeactivated() => updateState();
@ -140,7 +134,7 @@ namespace osu.Game.Overlays
} }
expandingBar.Expanded = barExpanded; expandingBar.Expanded = barExpanded;
text.FadeTo(textHighlighted ? 1 : 0.5f, transition_duration, Easing.OutQuint); text.FadeTo(textHighlighted ? 1 : 0.5f, 100, Easing.OutQuint);
} }
} }
} }