From 341ecd30fa6a99a9b5f3cd04cdb1667d51d146b7 Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Tue, 30 Jun 2026 16:17:41 +0300 Subject: [PATCH 1/2] Update style of extended details on profile page --- .../Header/Components/ExtendedDetails.cs | 124 ++++++++++++------ 1 file changed, 83 insertions(+), 41 deletions(-) diff --git a/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs b/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs index 777283485df4..609bc3b34a64 100644 --- a/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs +++ b/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs @@ -6,7 +6,9 @@ using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Resources.Localisation.Web; @@ -29,57 +31,68 @@ public partial class ExtendedDetails : CompositeDrawable private SpriteText replaysWatched = null!; [BackgroundDependencyLoader] - private void load() + private void load(OverlayColourProvider colourProvider) { - var font = OsuFont.Default.With(size: 12); const float vertical_spacing = 4; + const float horizontal_spacing = 20; AutoSizeAxes = Axes.Both; + CornerRadius = 6; + Masking = true; - // this should really be a grid, but trying to avoid one to avoid the performance hit. - InternalChild = new FillFlowContainer + InternalChildren = new Drawable[] { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(20, 0), - Children = new[] + new Box { - new FillFlowContainer + RelativeSizeAxes = Axes.Both, + Colour = colourProvider.Background4, + }, + // this should really be a grid, but trying to avoid one to avoid the performance hit. + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(horizontal_spacing, 0), + Padding = new MarginPadding { Vertical = 18, Horizontal = 12 }, + Children = new[] { - Name = @"Labels", - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, vertical_spacing), - Children = new Drawable[] + new FillFlowContainer { - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsRankedScore }, - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsHitAccuracy }, - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsPlayCount }, - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsTotalScore }, - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsTotalHits }, - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsHitsPerPlay }, - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsMaximumCombo }, - new OsuSpriteText { Font = font, Text = UsersStrings.ShowStatsReplaysWatchedByOthers }, - } - }, - new FillFlowContainer - { - Name = @"Values", - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, vertical_spacing), - Children = new Drawable[] + Name = @"Labels", + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, vertical_spacing), + Children = new Drawable[] + { + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsRankedScore), + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsHitAccuracy), + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsPlayCount), + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsTotalScore), + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsTotalHits), + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsHitsPerPlay), + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsMaximumCombo), + new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsReplaysWatchedByOthers), + } + }, + new FillFlowContainer { - rankedScore = new OsuSpriteText { Font = font }, - hitAccuracy = new OsuSpriteText { Font = font }, - playCount = new OsuSpriteText { Font = font }, - totalScore = new OsuSpriteText { Font = font }, - totalHits = new OsuSpriteText { Font = font }, - hitsPerPlay = new OsuSpriteText { Font = font }, - maximumCombo = new OsuSpriteText { Font = font }, - replaysWatched = new OsuSpriteText { Font = font }, - } - }, + Name = @"Values", + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, vertical_spacing), + Children = new Drawable[] + { + rankedScore = new ExtendedDetailsEntryValue(), + hitAccuracy = new ExtendedDetailsEntryValue(), + playCount = new ExtendedDetailsEntryValue(), + totalScore = new ExtendedDetailsEntryValue(), + totalHits = new ExtendedDetailsEntryValue(), + hitsPerPlay = new ExtendedDetailsEntryValue(), + maximumCombo = new ExtendedDetailsEntryValue(), + replaysWatched = new ExtendedDetailsEntryValue(), + } + }, + } } }; } @@ -115,5 +128,34 @@ private void updateStatistics(UserStatistics? statistics) maximumCombo.Text = statistics.MaxCombo.ToLocalisableString(@"N0"); replaysWatched.Text = statistics.ReplaysWatched.ToLocalisableString(@"N0"); } + + public partial class ExtendedDetailsEntryLabel : OsuSpriteText + { + public ExtendedDetailsEntryLabel(LocalisableString text) + { + Font = OsuFont.Default.With(size: 12); + Text = text; + } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + Colour = colourProvider.Content1; + } + } + + public partial class ExtendedDetailsEntryValue : OsuSpriteText + { + public ExtendedDetailsEntryValue() + { + Font = OsuFont.Default.With(size: 12, weight: FontWeight.Bold); + } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + Colour = colourProvider.Content2; + } + } } } From 3dd035610d1e738b80d8b870a6549fba81f27304 Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Tue, 30 Jun 2026 17:21:08 +0300 Subject: [PATCH 2/2] Slightly refactor new components --- .../Header/Components/ExtendedDetails.cs | 48 +++++++------------ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs b/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs index 609bc3b34a64..4f7f3157e36b 100644 --- a/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs +++ b/osu.Game/Overlays/Profile/Header/Components/ExtendedDetails.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Resources.Localisation.Web; @@ -64,14 +63,14 @@ private void load(OverlayColourProvider colourProvider) Spacing = new Vector2(0, vertical_spacing), Children = new Drawable[] { - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsRankedScore), - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsHitAccuracy), - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsPlayCount), - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsTotalScore), - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsTotalHits), - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsHitsPerPlay), - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsMaximumCombo), - new ExtendedDetailsEntryLabel(UsersStrings.ShowStatsReplaysWatchedByOthers), + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsRankedScore }, + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsHitAccuracy }, + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsPlayCount }, + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsTotalScore }, + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsTotalHits }, + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsHitsPerPlay }, + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsMaximumCombo }, + new ExtendedDetailsEntryLabel(colourProvider) { Text = UsersStrings.ShowStatsReplaysWatchedByOthers }, } }, new FillFlowContainer @@ -82,14 +81,14 @@ private void load(OverlayColourProvider colourProvider) Spacing = new Vector2(0, vertical_spacing), Children = new Drawable[] { - rankedScore = new ExtendedDetailsEntryValue(), - hitAccuracy = new ExtendedDetailsEntryValue(), - playCount = new ExtendedDetailsEntryValue(), - totalScore = new ExtendedDetailsEntryValue(), - totalHits = new ExtendedDetailsEntryValue(), - hitsPerPlay = new ExtendedDetailsEntryValue(), - maximumCombo = new ExtendedDetailsEntryValue(), - replaysWatched = new ExtendedDetailsEntryValue(), + rankedScore = new ExtendedDetailsEntryValue(colourProvider), + hitAccuracy = new ExtendedDetailsEntryValue(colourProvider), + playCount = new ExtendedDetailsEntryValue(colourProvider), + totalScore = new ExtendedDetailsEntryValue(colourProvider), + totalHits = new ExtendedDetailsEntryValue(colourProvider), + hitsPerPlay = new ExtendedDetailsEntryValue(colourProvider), + maximumCombo = new ExtendedDetailsEntryValue(colourProvider), + replaysWatched = new ExtendedDetailsEntryValue(colourProvider), } }, } @@ -131,29 +130,18 @@ private void updateStatistics(UserStatistics? statistics) public partial class ExtendedDetailsEntryLabel : OsuSpriteText { - public ExtendedDetailsEntryLabel(LocalisableString text) + public ExtendedDetailsEntryLabel(OverlayColourProvider colourProvider) { Font = OsuFont.Default.With(size: 12); - Text = text; - } - - [BackgroundDependencyLoader] - private void load(OverlayColourProvider colourProvider) - { Colour = colourProvider.Content1; } } public partial class ExtendedDetailsEntryValue : OsuSpriteText { - public ExtendedDetailsEntryValue() + public ExtendedDetailsEntryValue(OverlayColourProvider colourProvider) { Font = OsuFont.Default.With(size: 12, weight: FontWeight.Bold); - } - - [BackgroundDependencyLoader] - private void load(OverlayColourProvider colourProvider) - { Colour = colourProvider.Content2; } }