2018-07-20 01:07:24 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
|
|
|
{
|
|
|
|
|
public class TooltipIconButton : OsuClickableContainer, IHasTooltip
|
|
|
|
|
{
|
|
|
|
|
private readonly SpriteIcon icon;
|
|
|
|
|
|
|
|
|
|
public FontAwesome Icon
|
|
|
|
|
{
|
|
|
|
|
get { return icon.Icon; }
|
|
|
|
|
set { icon.Icon = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TooltipIconButton()
|
|
|
|
|
{
|
|
|
|
|
Children = new Drawable[]
|
2018-07-20 06:52:50 +08:00
|
|
|
|
{
|
|
|
|
|
new Box
|
2018-07-20 01:07:24 +08:00
|
|
|
|
{
|
2018-07-20 06:52:50 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
},
|
|
|
|
|
icon = new SpriteIcon
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(18),
|
|
|
|
|
}
|
|
|
|
|
};
|
2018-07-20 01:07:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string TooltipText { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|