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

47 lines
1.1 KiB
C#
Raw Normal View History

2021-10-18 03:34:31 +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.
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;
}
}
}