1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 18:27:19 +08:00

Fix triangles showing on ExpandableButtons when in contracted state

This commit is contained in:
Dean Herbert 2022-11-25 20:18:35 +09:00
parent d0c4637683
commit 76e9382e0b
2 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
{
public class RoundedButton : OsuButton, IFilterable
{
private TrianglesV2? triangles;
protected TrianglesV2? Triangles { get; private set; }
protected override float HoverLayerFinalAlpha => 0;
@ -63,7 +63,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
updateCornerRadius();
Add(triangles = new TrianglesV2
Add(Triangles = new TrianglesV2
{
Thickness = 0.02f,
SpawnRatio = 0.6f,
@ -76,13 +76,13 @@ namespace osu.Game.Graphics.UserInterfaceV2
private void updateColours()
{
if (triangles == null)
if (Triangles == null)
return;
Debug.Assert(triangleGradientSecondColour != null);
triangles.ColourTop = triangleGradientSecondColour.Value;
triangles.ColourBottom = BackgroundColour;
Triangles.ColourTop = triangleGradientSecondColour.Value;
Triangles.ColourBottom = BackgroundColour;
}
protected override bool OnHover(HoverEvent e)

View File

@ -86,6 +86,7 @@ namespace osu.Game.Rulesets.Edit
SpriteText.Font = OsuFont.GetFont(weight: FontWeight.Bold);
base.Height = actualHeight;
Background.Show();
Triangles?.Show();
}
else
{
@ -94,6 +95,7 @@ namespace osu.Game.Rulesets.Edit
SpriteText.Font = OsuFont.GetFont(weight: FontWeight.Regular);
base.Height = actualHeight / 2;
Background.Hide();
Triangles?.Hide();
}
}, true);
}