mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 11:42:55 +08:00
Adjust sizing of delete button
This commit is contained in:
parent
3e96c6d036
commit
0e93bbb62d
@ -22,6 +22,8 @@ namespace osu.Game.Collections
|
|||||||
{
|
{
|
||||||
private const float item_height = 35;
|
private const float item_height = 35;
|
||||||
|
|
||||||
|
private const float button_width = item_height * 0.75f;
|
||||||
|
|
||||||
public DrawableCollectionListItem(BeatmapCollection item)
|
public DrawableCollectionListItem(BeatmapCollection item)
|
||||||
: base(item)
|
: base(item)
|
||||||
{
|
{
|
||||||
@ -58,7 +60,7 @@ namespace osu.Game.Collections
|
|||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Right = item_height / 2 },
|
Padding = new MarginPadding { Right = button_width },
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
textBox = new ItemTextBox
|
textBox = new ItemTextBox
|
||||||
@ -100,8 +102,9 @@ namespace osu.Game.Collections
|
|||||||
public DeleteButton(BeatmapCollection collection)
|
public DeleteButton(BeatmapCollection collection)
|
||||||
{
|
{
|
||||||
this.collection = collection;
|
this.collection = collection;
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Y;
|
||||||
FillMode = FillMode.Fit;
|
|
||||||
|
Width = button_width + item_height / 2; // add corner radius to cover with fill
|
||||||
|
|
||||||
Alpha = 0.1f;
|
Alpha = 0.1f;
|
||||||
}
|
}
|
||||||
@ -119,8 +122,8 @@ namespace osu.Game.Collections
|
|||||||
new SpriteIcon
|
new SpriteIcon
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.Centre,
|
||||||
X = -6,
|
X = -button_width * 0.6f,
|
||||||
Size = new Vector2(10),
|
Size = new Vector2(10),
|
||||||
Icon = FontAwesome.Solid.Trash
|
Icon = FontAwesome.Solid.Trash
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user