1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 06:47:36 +08:00
osu-lazer/osu.Game/Beatmaps/Drawables/Cards/Buttons/BeatmapCardIconButton.cs
2021-11-08 11:53:53 +01:00

47 lines
1.1 KiB
C#

// 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.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
{
public abstract class BeatmapCardIconButton : OsuHoverContainer
{
protected readonly SpriteIcon Icon;
private float size;
public new float Size
{
get => size;
set
{
size = value;
Icon.Size = new Vector2(size);
}
}
protected BeatmapCardIconButton()
{
Add(Icon = new SpriteIcon());
AutoSizeAxes = Axes.Both;
Size = 12;
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
Anchor = Origin = Anchor.Centre;
IdleColour = colourProvider.Light1;
HoverColour = colourProvider.Content1;
}
}
}