1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00

Merge pull request #12564 from Joehuu/fix-beatmap-info-download-button-content-scaling

Fix beatmap info download button content not scaling on mouse down
This commit is contained in:
Dean Herbert 2021-05-01 10:43:59 +09:00 committed by GitHub
commit cbc7753f23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,52 +47,44 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
{ {
FillFlowContainer textSprites; FillFlowContainer textSprites;
AddRangeInternal(new Drawable[] AddInternal(shakeContainer = new ShakeContainer
{ {
shakeContainer = new ShakeContainer RelativeSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 5,
Child = button = new HeaderButton { RelativeSizeAxes = Axes.Both },
});
button.AddRange(new Drawable[]
{
new Container
{ {
Depth = -1, Padding = new MarginPadding { Horizontal = 10 },
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 5,
Children = new Drawable[] Children = new Drawable[]
{ {
button = new HeaderButton { RelativeSizeAxes = Axes.Both }, textSprites = new FillFlowContainer
new Container
{ {
// cannot nest inside here due to the structure of button (putting things in its own content). Anchor = Anchor.CentreLeft,
// requires framework fix. Origin = Anchor.CentreLeft,
Padding = new MarginPadding { Horizontal = 10 }, AutoSizeAxes = Axes.Both,
RelativeSizeAxes = Axes.Both, AutoSizeDuration = 500,
Children = new Drawable[] AutoSizeEasing = Easing.OutQuint,
{ Direction = FillDirection.Vertical,
textSprites = new FillFlowContainer
{
Depth = -1,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
AutoSizeAxes = Axes.Both,
AutoSizeDuration = 500,
AutoSizeEasing = Easing.OutQuint,
Direction = FillDirection.Vertical,
},
new SpriteIcon
{
Depth = -1,
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Icon = FontAwesome.Solid.Download,
Size = new Vector2(18),
},
}
}, },
new DownloadProgressBar(BeatmapSet.Value) new SpriteIcon
{ {
Depth = -2, Anchor = Anchor.CentreRight,
Anchor = Anchor.BottomLeft, Origin = Anchor.CentreRight,
Origin = Anchor.BottomLeft, Icon = FontAwesome.Solid.Download,
Size = new Vector2(18),
}, },
}, }
},
new DownloadProgressBar(BeatmapSet.Value)
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
}, },
}); });