1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Use scale instead of rotation in profile cover toggle button

This commit is contained in:
Salman Ahmed 2024-07-08 08:32:29 +03:00
parent 5223e0aeae
commit be039b85ad

View File

@ -50,12 +50,13 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(10.5f, 12)
Size = new Vector2(10.5f, 12),
Icon = FontAwesome.Solid.ChevronDown,
};
CoverExpanded.BindValueChanged(visible => updateState(visible.NewValue), true);
}
private void updateState(bool detailsVisible) => icon.Icon = detailsVisible ? FontAwesome.Solid.ChevronUp : FontAwesome.Solid.ChevronDown;
private void updateState(bool detailsVisible) => icon.ScaleTo(detailsVisible ? new Vector2(1f, -1f) : Vector2.One, 300, Easing.OutQuint);
}
}