From 1d1da1bc13c7f1c613aa8bba35c8f5b90a819b15 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 11 Sep 2019 11:26:09 +0300 Subject: [PATCH] Visual improvements --- osu.Game/Overlays/Rankings/HeaderFlag.cs | 34 +++++++++--------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/osu.Game/Overlays/Rankings/HeaderFlag.cs b/osu.Game/Overlays/Rankings/HeaderFlag.cs index 5b00e3e487..8bd4bdf13f 100644 --- a/osu.Game/Overlays/Rankings/HeaderFlag.cs +++ b/osu.Game/Overlays/Rankings/HeaderFlag.cs @@ -20,49 +20,39 @@ namespace osu.Game.Overlays.Rankings public Action Action; - private readonly Container hoverContainer; + private readonly SpriteIcon hoverIcon; public HeaderFlag() { - AddInternal(hoverContainer = new Container + AddInternal(hoverIcon = new SpriteIcon { - Alpha = 0, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Depth = -1, - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new SpriteIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Size = new Vector2(15), - Icon = FontAwesome.Solid.Times, - }, - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black.Opacity(100), - } - } + Alpha = 0, + Size = new Vector2(10), + Icon = FontAwesome.Solid.Times, }); } protected override bool OnHover(HoverEvent e) { - hoverContainer.FadeIn(duration, Easing.OutQuint); + hoverIcon.FadeIn(duration, Easing.OutQuint); + this.FadeColour(Color4.Gray, duration, Easing.OutQuint); return base.OnHover(e); } protected override void OnHoverLost(HoverLostEvent e) { base.OnHoverLost(e); - hoverContainer.FadeOut(duration, Easing.OutQuint); + hoverIcon.FadeOut(duration, Easing.OutQuint); + this.FadeColour(Color4.White, duration, Easing.OutQuint); } protected override bool OnClick(ClickEvent e) { Action?.Invoke(); - return base.OnClick(e); + return true; } } }