mirror of
https://github.com/ppy/osu
synced 2025-02-18 11:26:57 +00:00
Remove GetWidth function
This commit is contained in:
parent
4d5445b5dc
commit
17f2baf600
@ -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;
|
||||
|
@ -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<T> : TabItem<T>
|
||||
{
|
||||
private const float transition_duration = 100;
|
||||
private const float tab_width = 100;
|
||||
|
||||
public readonly Bindable<T> SelectedItem = new Bindable<T>();
|
||||
|
||||
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<SpriteText>
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user