mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Restyle card buttons to resemble buttons more
This commit is contained in:
@ -0,0 +1,10 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Drawables.Cards
|
||||||
|
{
|
||||||
|
public class BeatmapCardDownloadProgressBar
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
@ -12,26 +16,45 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
|||||||
{
|
{
|
||||||
public abstract class BeatmapCardIconButton : OsuHoverContainer
|
public abstract class BeatmapCardIconButton : OsuHoverContainer
|
||||||
{
|
{
|
||||||
|
protected override IEnumerable<Drawable> EffectTargets => background.Yield();
|
||||||
|
|
||||||
|
private readonly Box background;
|
||||||
protected readonly SpriteIcon Icon;
|
protected readonly SpriteIcon Icon;
|
||||||
|
|
||||||
private float size;
|
private float iconSize;
|
||||||
|
|
||||||
public new float Size
|
public float IconSize
|
||||||
{
|
{
|
||||||
get => size;
|
get => iconSize;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
size = value;
|
iconSize = value;
|
||||||
Icon.Size = new Vector2(size);
|
Icon.Size = new Vector2(iconSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BeatmapCardIconButton()
|
protected BeatmapCardIconButton()
|
||||||
{
|
{
|
||||||
Add(Icon = new SpriteIcon());
|
Child = new CircularContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
background = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both
|
||||||
|
},
|
||||||
|
Icon = new SpriteIcon
|
||||||
|
{
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
Size = new Vector2(24);
|
||||||
Size = 12;
|
IconSize = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -39,8 +62,9 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
|||||||
{
|
{
|
||||||
Anchor = Origin = Anchor.Centre;
|
Anchor = Origin = Anchor.Centre;
|
||||||
|
|
||||||
IdleColour = colourProvider.Light1;
|
IdleColour = colourProvider.Background4;
|
||||||
HoverColour = colourProvider.Content1;
|
HoverColour = colourProvider.Background1;
|
||||||
|
Icon.Colour = colourProvider.Content2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user