1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 06:47:25 +08:00
osu-lazer/osu.Game/Overlays/Profile/Header/ProfileHeaderButton.cs

55 lines
1.7 KiB
C#
Raw Normal View History

2019-03-10 06:58:14 +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 System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2019-04-26 12:29:58 +08:00
using osu.Framework.Graphics.Cursor;
2019-03-10 06:58:14 +08:00
using osu.Framework.Graphics.Shapes;
2019-04-25 18:51:05 +08:00
using osu.Game.Graphics;
2019-03-10 06:58:14 +08:00
using osu.Game.Graphics.Containers;
using osuTK.Graphics;
namespace osu.Game.Overlays.Profile.Header
{
2019-04-26 12:29:58 +08:00
public abstract class ProfileHeaderButton : OsuHoverContainer, IHasTooltip
2019-03-10 06:58:14 +08:00
{
2019-04-26 12:29:58 +08:00
public abstract string TooltipText { get; }
2019-03-10 06:58:14 +08:00
private readonly Box background;
private readonly Container content;
protected override Container<Drawable> Content => content;
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
2019-04-26 12:29:58 +08:00
protected ProfileHeaderButton()
2019-03-10 06:58:14 +08:00
{
2019-04-25 19:05:59 +08:00
AutoSizeAxes = Axes.X;
2019-04-25 18:51:05 +08:00
IdleColour = Color4.Black;
HoverColour = OsuColour.Gray(0.1f);
2019-03-10 06:58:14 +08:00
base.Content.Add(new CircularContainer
{
Masking = true,
AutoSizeAxes = Axes.X,
RelativeSizeAxes = Axes.Y,
Children = new Drawable[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both,
},
content = new Container
{
AutoSizeAxes = Axes.X,
RelativeSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = 10 },
}
}
});
}
}
}