Update ShowMoreButton in line with web

This commit is contained in:
Andrei Zavatski
2020-07-30 04:51:09 +03:00
parent 91ce06aaa7
commit d4496eb982
6 changed files with 76 additions and 78 deletions

View File

@ -5,12 +5,12 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osuTK;
using static osu.Game.Graphics.UserInterface.ShowMoreButton;
namespace osu.Game.Overlays.Comments.Buttons
{
@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Comments.Buttons
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
private readonly SpriteIcon icon;
private readonly ChevronIcon icon;
private readonly Box background;
private readonly OsuSpriteText text;
@ -68,12 +68,10 @@ namespace osu.Game.Overlays.Comments.Buttons
AlwaysPresent = true,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold)
},
icon = new SpriteIcon
icon = new ChevronIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Size = new Vector2(7.5f),
Icon = FontAwesome.Solid.ChevronDown
Origin = Anchor.CentreLeft
}
}
}
@ -88,7 +86,6 @@ namespace osu.Game.Overlays.Comments.Buttons
private void load()
{
background.Colour = colourProvider.Background2;
icon.Colour = colourProvider.Foreground1;
}
protected void SetIconDirection(bool upwards) => icon.ScaleTo(new Vector2(1, upwards ? -1 : 1));
@ -99,7 +96,7 @@ namespace osu.Game.Overlays.Comments.Buttons
{
base.OnHover(e);
background.FadeColour(colourProvider.Background1, 200, Easing.OutQuint);
icon.FadeColour(colourProvider.Light1, 200, Easing.OutQuint);
icon.FadeHoverColour();
return true;
}
@ -107,7 +104,7 @@ namespace osu.Game.Overlays.Comments.Buttons
{
base.OnHoverLost(e);
background.FadeColour(colourProvider.Background2, 200, Easing.OutQuint);
icon.FadeColour(colourProvider.Foreground1, 200, Easing.OutQuint);
icon.FadeIdleColour();
}
}
}