mirror of
https://github.com/ppy/osu
synced 2024-12-27 17:32:56 +00:00
Make beatmap card icon buttons fill up to the area
This commit is contained in:
parent
aa8040d696
commit
6c316bcc9e
@ -59,8 +59,9 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(25f, 50f),
|
||||
Scale = new Vector2(2f),
|
||||
State = { Value = DownloadState.NotDownloaded },
|
||||
Scale = new Vector2(2)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
@ -37,7 +37,11 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
beatmapSetInfo = CreateAPIBeatmapSet(Ruleset.Value);
|
||||
beatmapSetInfo.HasFavourited = favourited;
|
||||
});
|
||||
AddStep("create button", () => Child = button = new FavouriteButton(beatmapSetInfo) { Scale = new Vector2(2) });
|
||||
AddStep("create button", () => Child = button = new FavouriteButton(beatmapSetInfo)
|
||||
{
|
||||
Size = new Vector2(25f, 50f),
|
||||
Scale = new Vector2(2f),
|
||||
});
|
||||
|
||||
assertCorrectIcon(favourited);
|
||||
AddAssert("correct tooltip text", () => button.TooltipText == (favourited ? BeatmapsetsStrings.ShowDetailsUnfavourite : BeatmapsetsStrings.ShowDetailsFavourite));
|
||||
@ -51,7 +55,11 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
BeatmapFavouriteAction? lastRequestAction = null;
|
||||
|
||||
AddStep("create beatmap set", () => beatmapSetInfo = CreateAPIBeatmapSet(Ruleset.Value));
|
||||
AddStep("create button", () => Child = button = new FavouriteButton(beatmapSetInfo) { Scale = new Vector2(2) });
|
||||
AddStep("create button", () => Child = button = new FavouriteButton(beatmapSetInfo)
|
||||
{
|
||||
Size = new Vector2(25f, 50f),
|
||||
Scale = new Vector2(2f),
|
||||
});
|
||||
|
||||
assertCorrectIcon(false);
|
||||
|
||||
|
@ -81,7 +81,6 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
FavouriteState = { BindTarget = FavouriteState },
|
||||
ButtonsCollapsedWidth = CORNER_RADIUS,
|
||||
ButtonsExpandedWidth = 30,
|
||||
ButtonsPadding = new MarginPadding { Vertical = 35 },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
|
@ -82,7 +82,6 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
FavouriteState = { BindTarget = FavouriteState },
|
||||
ButtonsCollapsedWidth = CORNER_RADIUS,
|
||||
ButtonsExpandedWidth = 30,
|
||||
ButtonsPadding = new MarginPadding { Vertical = 17.5f },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
|
@ -92,7 +92,6 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
||||
}
|
||||
});
|
||||
|
||||
Size = new Vector2(24);
|
||||
IconSize = 12;
|
||||
}
|
||||
|
||||
|
@ -48,12 +48,6 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
}
|
||||
}
|
||||
|
||||
public MarginPadding ButtonsPadding
|
||||
{
|
||||
get => buttons.Padding;
|
||||
set => buttons.Padding = value;
|
||||
}
|
||||
|
||||
protected override Container<Drawable> Content => mainContent;
|
||||
|
||||
private readonly Container background;
|
||||
@ -104,25 +98,32 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
Child = buttons = new Container<BeatmapCardIconButton>
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding(3),
|
||||
Children = new BeatmapCardIconButton[]
|
||||
{
|
||||
new FavouriteButton(beatmapSet)
|
||||
{
|
||||
Current = FavouriteState,
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre
|
||||
Origin = Anchor.TopCentre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Height = 0.48f,
|
||||
},
|
||||
new DownloadButton(beatmapSet)
|
||||
{
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
State = { BindTarget = downloadTracker.State }
|
||||
State = { BindTarget = downloadTracker.State },
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Height = 0.48f,
|
||||
},
|
||||
new GoToBeatmapButton(beatmapSet)
|
||||
{
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
State = { BindTarget = downloadTracker.State }
|
||||
State = { BindTarget = downloadTracker.State },
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Height = 0.48f,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user