1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 06:38:27 +08:00

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.6 KiB
C#
Raw Normal View History

// 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.
2018-04-13 18:19:50 +09:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
2018-11-20 16:51:59 +09:00
using osuTK;
using osuTK.Graphics;
2018-04-13 18:19:50 +09:00
namespace osu.Game.Beatmaps.Drawables.Cards
{
public abstract partial class IconPill : CircularContainer, IHasTooltip
{
2019-03-05 17:14:49 +09:00
public Vector2 IconSize
{
get => iconContainer.Size;
set => iconContainer.Size = value;
}
private readonly Container iconContainer;
protected IconPill(IconUsage icon)
{
AutoSizeAxes = Axes.Both;
Masking = true;
2018-04-13 18:19:50 +09:00
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.5f,
},
2019-03-05 17:14:49 +09:00
iconContainer = new Container
{
2019-03-05 17:14:49 +09:00
Size = new Vector2(22),
Padding = new MarginPadding(5),
Child = new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2019-03-05 17:14:49 +09:00
RelativeSizeAxes = Axes.Both,
Icon = icon,
},
},
};
}
public abstract LocalisableString TooltipText { get; }
}
}