2021-02-02 15:57:08 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-02-02 15:57:08 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
|
|
{
|
|
|
|
public class GrayButton : OsuAnimatedButton
|
|
|
|
{
|
2021-02-02 18:14:44 +08:00
|
|
|
protected SpriteIcon Icon { get; private set; }
|
|
|
|
protected Box Background { get; private set; }
|
2021-02-02 15:57:08 +08:00
|
|
|
|
|
|
|
private readonly IconUsage icon;
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
private OsuColour colours { get; set; }
|
|
|
|
|
|
|
|
public GrayButton(IconUsage icon)
|
|
|
|
{
|
|
|
|
this.icon = icon;
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2021-08-10 14:14:43 +08:00
|
|
|
AddRange(new Drawable[]
|
2021-02-02 15:57:08 +08:00
|
|
|
{
|
|
|
|
Background = new Box
|
|
|
|
{
|
|
|
|
Colour = colours.Gray4,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Depth = float.MaxValue
|
|
|
|
},
|
|
|
|
Icon = new SpriteIcon
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Size = new Vector2(13),
|
|
|
|
Icon = icon,
|
|
|
|
},
|
2021-08-10 14:14:43 +08:00
|
|
|
});
|
2021-02-02 15:57:08 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|