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