1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Adjust sizing of delete button

This commit is contained in:
Dean Herbert 2020-09-08 13:02:58 +09:00
parent 3e96c6d036
commit 0e93bbb62d

View File

@ -22,6 +22,8 @@ namespace osu.Game.Collections
{
private const float item_height = 35;
private const float button_width = item_height * 0.75f;
public DrawableCollectionListItem(BeatmapCollection item)
: base(item)
{
@ -58,7 +60,7 @@ namespace osu.Game.Collections
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Right = item_height / 2 },
Padding = new MarginPadding { Right = button_width },
Children = new Drawable[]
{
textBox = new ItemTextBox
@ -100,8 +102,9 @@ namespace osu.Game.Collections
public DeleteButton(BeatmapCollection collection)
{
this.collection = collection;
RelativeSizeAxes = Axes.Both;
FillMode = FillMode.Fit;
RelativeSizeAxes = Axes.Y;
Width = button_width + item_height / 2; // add corner radius to cover with fill
Alpha = 0.1f;
}
@ -119,8 +122,8 @@ namespace osu.Game.Collections
new SpriteIcon
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
X = -6,
Origin = Anchor.Centre,
X = -button_width * 0.6f,
Size = new Vector2(10),
Icon = FontAwesome.Solid.Trash
}