Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale down beatmap cards #30748

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions osu.Game.Tests/Visual/Online/TestSceneUserProfileOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
Expand Down Expand Up @@ -58,6 +59,16 @@ public void TestActualUser()
return true;
}

if (req is GetUserBeatmapsRequest getUserBeatmapsRequest)
{
getUserBeatmapsRequest.TriggerSuccess(new List<APIBeatmapSet>
{
CreateAPIBeatmapSet(),
CreateAPIBeatmapSet()
});
return true;
}

return false;
};
});
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public BeatmapSetOnlineStatusPill()
};

Status = BeatmapOnlineStatus.None;
TextPadding = new MarginPadding { Horizontal = 5, Bottom = 1 };
TextPadding = new MarginPadding { Horizontal = 4, Bottom = 1 };
}

protected override void LoadComplete()
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Beatmaps/Drawables/Cards/BeatmapCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ namespace osu.Game.Beatmaps.Drawables.Cards
public abstract partial class BeatmapCard : OsuClickableContainer, IHasContextMenu
{
public const float TRANSITION_DURATION = 340;
public const float CORNER_RADIUS = 10;
public const float CORNER_RADIUS = 8;

protected const float WIDTH = 430;
protected const float WIDTH = 345;

public IBindable<bool> Expanded { get; }

Expand Down
34 changes: 17 additions & 17 deletions osu.Game/Beatmaps/Drawables/Cards/BeatmapCardExtra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class BeatmapCardExtra : BeatmapCard
protected override Drawable IdleContent => idleBottomContent;
protected override Drawable DownloadInProgressContent => downloadProgressBar;

private const float height = 140;
private const float height = 112;

[Cached]
private readonly BeatmapCardContent content;
Expand Down Expand Up @@ -68,7 +68,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
Padding = new MarginPadding { Right = CORNER_RADIUS },
Child = leftIconArea = new FillFlowContainer
{
Margin = new MarginPadding(5),
Margin = new MarginPadding(4),
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(1)
Expand All @@ -80,7 +80,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
Width = WIDTH - height + CORNER_RADIUS,
FavouriteState = { BindTarget = FavouriteState },
ButtonsCollapsedWidth = CORNER_RADIUS,
ButtonsExpandedWidth = 30,
ButtonsExpandedWidth = 24,
Children = new Drawable[]
{
new FillFlowContainer
Expand Down Expand Up @@ -109,7 +109,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
new TruncatingSpriteText
{
Text = new RomanisableString(BeatmapSet.TitleUnicode, BeatmapSet.Title),
Font = OsuFont.Default.With(size: 22.5f, weight: FontWeight.SemiBold),
Font = OsuFont.Default.With(size: 18f, weight: FontWeight.SemiBold),
RelativeSizeAxes = Axes.X,
},
titleBadgeArea = new FillFlowContainer
Expand Down Expand Up @@ -142,7 +142,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
new TruncatingSpriteText
{
Text = createArtistText(),
Font = OsuFont.Default.With(size: 17.5f, weight: FontWeight.SemiBold),
Font = OsuFont.Default.With(size: 14f, weight: FontWeight.SemiBold),
RelativeSizeAxes = Axes.X,
},
Empty()
Expand All @@ -154,7 +154,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
RelativeSizeAxes = Axes.X,
Text = BeatmapSet.Source,
Shadow = false,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold),
Font = OsuFont.GetFont(size: 11f, weight: FontWeight.SemiBold),
Colour = colourProvider.Content2
},
}
Expand All @@ -173,18 +173,18 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 3),
Spacing = new Vector2(0, 2),
AlwaysPresent = true,
Children = new Drawable[]
{
new LinkFlowContainer(s =>
{
s.Shadow = false;
s.Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold);
s.Font = OsuFont.GetFont(size: 11f, weight: FontWeight.SemiBold);
}).With(d =>
{
d.AutoSizeAxes = Axes.Both;
d.Margin = new MarginPadding { Top = 2 };
d.Margin = new MarginPadding { Top = 1 };
d.AddText("mapped by ", t => t.Colour = colourProvider.Content2);
d.AddUserLink(BeatmapSet.Author);
}),
Expand Down Expand Up @@ -215,7 +215,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
downloadProgressBar = new BeatmapCardDownloadProgressBar
{
RelativeSizeAxes = Axes.X,
Height = 6,
Height = 5,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
State = { BindTarget = DownloadTracker.State },
Expand All @@ -231,25 +231,25 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = 10, Vertical = 13 },
Padding = new MarginPadding { Horizontal = 8, Vertical = 10 },
Child = new BeatmapCardDifficultyList(BeatmapSet)
};
c.Expanded.BindTarget = Expanded;
});

if (BeatmapSet.HasVideo)
leftIconArea.Add(new VideoIconPill { IconSize = new Vector2(20) });
leftIconArea.Add(new VideoIconPill { IconSize = new Vector2(16) });

if (BeatmapSet.HasStoryboard)
leftIconArea.Add(new StoryboardIconPill { IconSize = new Vector2(20) });
leftIconArea.Add(new StoryboardIconPill { IconSize = new Vector2(16) });

if (BeatmapSet.FeaturedInSpotlight)
{
titleBadgeArea.Add(new SpotlightBeatmapBadge
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding { Left = 5 }
Margin = new MarginPadding { Left = 4 }
});
}

Expand All @@ -259,7 +259,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding { Left = 5 }
Margin = new MarginPadding { Left = 4 }
});
}

Expand All @@ -269,7 +269,7 @@ private void load(BeatmapSetOverlay? beatmapSetOverlay)
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding { Left = 5 }
Margin = new MarginPadding { Left = 4 }
};
}

Expand All @@ -288,7 +288,7 @@ private void createStatistics()
{
BeatmapCardStatistic withMargin(BeatmapCardStatistic original)
{
original.Margin = new MarginPadding { Right = 10 };
original.Margin = new MarginPadding { Right = 8 };
return original;
}

Expand Down
7 changes: 4 additions & 3 deletions osu.Game/Beatmaps/Drawables/Cards/BeatmapCardExtraInfoRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ public BeatmapCardExtraInfoRow(APIBeatmapSet beatmapSet)
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(4, 0),
Spacing = new Vector2(3, 0),
Children = new Drawable[]
{
new BeatmapSetOnlineStatusPill
{
AutoSizeAxes = Axes.Both,
Status = beatmapSet.Status,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft
Origin = Anchor.CentreLeft,
TextSize = 13f
},
new DifficultySpectrumDisplay(beatmapSet)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
DotSize = new Vector2(6, 12)
DotSize = new Vector2(5, 10)
}
}
};
Expand Down
32 changes: 16 additions & 16 deletions osu.Game/Beatmaps/Drawables/Cards/BeatmapCardNormal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class BeatmapCardNormal : BeatmapCard
protected override Drawable IdleContent => idleBottomContent;
protected override Drawable DownloadInProgressContent => downloadProgressBar;

public const float HEIGHT = 100;
public const float HEIGHT = 80;

[Cached]
private readonly BeatmapCardContent content;
Expand Down Expand Up @@ -69,7 +69,7 @@ private void load()
Padding = new MarginPadding { Right = CORNER_RADIUS },
Child = leftIconArea = new FillFlowContainer
{
Margin = new MarginPadding(5),
Margin = new MarginPadding(4),
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(1)
Expand All @@ -81,7 +81,7 @@ private void load()
Width = WIDTH - HEIGHT + CORNER_RADIUS,
FavouriteState = { BindTarget = FavouriteState },
ButtonsCollapsedWidth = CORNER_RADIUS,
ButtonsExpandedWidth = 30,
ButtonsExpandedWidth = 24,
Children = new Drawable[]
{
new FillFlowContainer
Expand Down Expand Up @@ -110,7 +110,7 @@ private void load()
new TruncatingSpriteText
{
Text = new RomanisableString(BeatmapSet.TitleUnicode, BeatmapSet.Title),
Font = OsuFont.Default.With(size: 22.5f, weight: FontWeight.SemiBold),
Font = OsuFont.Default.With(size: 18f, weight: FontWeight.SemiBold),
RelativeSizeAxes = Axes.X,
},
titleBadgeArea = new FillFlowContainer
Expand Down Expand Up @@ -143,7 +143,7 @@ private void load()
new TruncatingSpriteText
{
Text = createArtistText(),
Font = OsuFont.Default.With(size: 17.5f, weight: FontWeight.SemiBold),
Font = OsuFont.Default.With(size: 14f, weight: FontWeight.SemiBold),
RelativeSizeAxes = Axes.X,
},
Empty()
Expand All @@ -153,11 +153,11 @@ private void load()
new LinkFlowContainer(s =>
{
s.Shadow = false;
s.Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold);
s.Font = OsuFont.GetFont(size: 11f, weight: FontWeight.SemiBold);
}).With(d =>
{
d.AutoSizeAxes = Axes.Both;
d.Margin = new MarginPadding { Top = 2 };
d.Margin = new MarginPadding { Top = 1 };
d.AddText("mapped by ", t => t.Colour = colourProvider.Content2);
d.AddUserLink(BeatmapSet.Author);
}),
Expand All @@ -177,7 +177,7 @@ private void load()
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 3),
Spacing = new Vector2(0, 2),
AlwaysPresent = true,
Children = new Drawable[]
{
Expand All @@ -186,7 +186,7 @@ private void load()
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0),
Spacing = new Vector2(8, 0),
Alpha = 0,
AlwaysPresent = true,
ChildrenEnumerable = createStatistics()
Expand All @@ -197,7 +197,7 @@ private void load()
downloadProgressBar = new BeatmapCardDownloadProgressBar
{
RelativeSizeAxes = Axes.X,
Height = 6,
Height = 5,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
State = { BindTarget = DownloadTracker.State },
Expand All @@ -213,25 +213,25 @@ private void load()
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = 10, Vertical = 13 },
Padding = new MarginPadding { Horizontal = 8, Vertical = 10 },
Child = new BeatmapCardDifficultyList(BeatmapSet)
};
c.Expanded.BindTarget = Expanded;
});

if (BeatmapSet.HasVideo)
leftIconArea.Add(new VideoIconPill { IconSize = new Vector2(20) });
leftIconArea.Add(new VideoIconPill { IconSize = new Vector2(16) });

if (BeatmapSet.HasStoryboard)
leftIconArea.Add(new StoryboardIconPill { IconSize = new Vector2(20) });
leftIconArea.Add(new StoryboardIconPill { IconSize = new Vector2(16) });

if (BeatmapSet.FeaturedInSpotlight)
{
titleBadgeArea.Add(new SpotlightBeatmapBadge
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding { Left = 5 }
Margin = new MarginPadding { Left = 4 }
});
}

Expand All @@ -241,7 +241,7 @@ private void load()
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding { Left = 5 }
Margin = new MarginPadding { Left = 4 }
});
}

Expand All @@ -251,7 +251,7 @@ private void load()
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding { Left = 5 }
Margin = new MarginPadding { Left = 4 }
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ protected BeatmapCardStatistic()
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5, 0),
Spacing = new Vector2(4, 0),
Children = new Drawable[]
{
spriteIcon = new SpriteIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Size = new Vector2(10),
Size = new Vector2(8),
Margin = new MarginPadding { Top = 1 }
},
spriteText = new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Font = OsuFont.Default.With(size: 14)
Font = OsuFont.Default.With(size: 11)
}
}
};
Expand Down
1 change: 0 additions & 1 deletion osu.Game/Overlays/BeatmapListingOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ private IEnumerable<BeatmapCard> createCardsFor(IEnumerable<APIBeatmapSet> beatm
{
c.Anchor = Anchor.TopCentre;
c.Origin = Anchor.TopCentre;
c.Scale = new Vector2(0.8f);
})).ToArray();

private static ReverseChildIDFillFlowContainer<BeatmapCard> createCardContainerFor(IEnumerable<BeatmapCard> newCards)
Expand Down
Loading
Loading