1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00

headerbutton now derives from osubutton

This commit is contained in:
Santeri Nogelainen 2017-11-27 13:39:01 +02:00
parent b3279082e2
commit bf8d15108e
3 changed files with 24 additions and 23 deletions

View File

@ -14,10 +14,10 @@ namespace osu.Game.Overlays.BeatmapSet
public DownloadButton(string title, string subtitle)
{
Width = 120;
RelativeSizeAxes = Axes.Y;
Child = new Container
{
Depth = -1,
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = 10 },
Children = new Drawable[]

View File

@ -17,7 +17,6 @@ namespace osu.Game.Overlays.BeatmapSet
public FavouriteButton()
{
RelativeSizeAxes = Axes.Y;
Container pink;
SpriteIcon icon;
@ -25,6 +24,7 @@ namespace osu.Game.Overlays.BeatmapSet
{
pink = new Container
{
Depth = -1,
RelativeSizeAxes = Axes.Both,
Alpha = 0f,
Children = new Drawable[]
@ -45,6 +45,7 @@ namespace osu.Game.Overlays.BeatmapSet
},
icon = new SpriteIcon
{
Depth = -1,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Icon = FontAwesome.fa_heart_o,

View File

@ -5,12 +5,15 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
using osu.Framework.Audio;
using osu.Framework.Allocation;
namespace osu.Game.Overlays.BeatmapSet
{
public class HeaderButton : OsuClickableContainer
public class HeaderButton : OsuButton
{
private readonly Container content;
@ -18,28 +21,25 @@ namespace osu.Game.Overlays.BeatmapSet
public HeaderButton()
{
CornerRadius = 3;
Masking = true;
Height = 0;
RelativeSizeAxes = Axes.Y;
InternalChildren = new Drawable[]
AddInternal(content = new Container
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex(@"094c5f"),
},
new Triangles
{
RelativeSizeAxes = Axes.Both,
ColourLight = OsuColour.FromHex(@"0f7c9b"),
ColourDark = OsuColour.FromHex(@"094c5f"),
TriangleScale = 1.5f,
},
content = new Container
{
RelativeSizeAxes = Axes.Both,
},
};
RelativeSizeAxes = Axes.Both
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours, AudioManager audio)
{
Masking = true;
CornerRadius = 3;
BackgroundColour = OsuColour.FromHex(@"094c5f");
Triangles.ColourLight = OsuColour.FromHex(@"0f7c9b");
Triangles.ColourDark = OsuColour.FromHex(@"094c5f");
Triangles.TriangleScale = 1.5f;
}
}
}