mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 22:23:22 +08:00
Fix long recent activity text overlapping timestamp.
- Also remove unnecessary fallback from absolute URL helper
This commit is contained in:
parent
a77d1eedae
commit
62913163e0
@ -19,19 +19,16 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
||||
private APIAccess api;
|
||||
|
||||
private readonly RecentActivity activity;
|
||||
private readonly string userLinkTemplate;
|
||||
private readonly string beatmapLinkTemplate;
|
||||
private readonly string beatmapsetLinkTemplate;
|
||||
|
||||
private string userLinkTemplate;
|
||||
private string beatmapLinkTemplate;
|
||||
private string beatmapsetLinkTemplate;
|
||||
|
||||
private LinkFlowContainer content;
|
||||
|
||||
public DrawableRecentActivity(RecentActivity activity)
|
||||
{
|
||||
this.activity = activity;
|
||||
|
||||
userLinkTemplate = $"[{urlToAbsolute(activity.User?.Url)} {activity.User?.Username}]";
|
||||
beatmapLinkTemplate = $"[{urlToAbsolute(activity.Beatmap?.Url)} {activity.Beatmap?.Title}]";
|
||||
beatmapsetLinkTemplate = $"[{urlToAbsolute(activity.Beatmapset?.Url)} {activity.Beatmapset?.Title}]";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -39,6 +36,12 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
||||
{
|
||||
this.api = api;
|
||||
|
||||
userLinkTemplate = $"[{toAbsoluteUrl(activity.User?.Url)} {activity.User?.Username}]";
|
||||
beatmapLinkTemplate = $"[{toAbsoluteUrl(activity.Beatmap?.Url)} {activity.Beatmap?.Title}]";
|
||||
beatmapsetLinkTemplate = $"[{toAbsoluteUrl(activity.Beatmapset?.Url)} {activity.Beatmapset?.Title}]";
|
||||
|
||||
LeftFlowContainer.Padding = new MarginPadding { Left = 10, Right = 160 };
|
||||
|
||||
LeftFlowContainer.Add(content = new LinkFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
@ -90,7 +93,7 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
||||
}
|
||||
}
|
||||
|
||||
private string urlToAbsolute(string url) => $"{api?.Endpoint ?? @"https://osu.ppy.sh"}{url}";
|
||||
private string toAbsoluteUrl(string url) => $"{api.Endpoint}{url}";
|
||||
|
||||
private string activityToString()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user