From 132cb8f47377b45aa97575a43cc5a04abc850148 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 22 Jun 2019 01:11:04 +0300 Subject: [PATCH 1/8] Add spacing between sections --- osu.Game/Overlays/UserProfileOverlay.cs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 8a133a1d1e..f712509702 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -4,6 +4,7 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; @@ -23,7 +24,7 @@ namespace osu.Game.Overlays private ProfileSection[] sections; private GetUserRequest userReq; protected ProfileHeader Header; - private SectionsContainer sectionsContainer; + private ProfileSectionsContainer sectionsContainer; private ProfileTabControl tabs; public const float CONTENT_X_MARGIN = 70; @@ -68,9 +69,8 @@ namespace osu.Game.Overlays Colour = OsuColour.Gray(0.2f) }); - Add(sectionsContainer = new SectionsContainer + Add(sectionsContainer = new ProfileSectionsContainer { - RelativeSizeAxes = Axes.Both, ExpandableHeader = Header = new ProfileHeader(), FixedHeader = tabs, HeaderBackground = new Box @@ -180,5 +180,22 @@ namespace osu.Game.Overlays bottom.Colour = colours.Yellow; } } + + private class ProfileSectionsContainer : SectionsContainer + { + public ProfileSectionsContainer() + { + RelativeSizeAxes = Axes.Both; + } + + protected override FlowContainer CreateScrollContentContainer() + => new FillFlowContainer + { + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Spacing = new Vector2(0, 20), + }; + } } } From dbf53e9bda54ceb3405c6d51f69999cd1d419e50 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 22 Jun 2019 02:06:30 +0300 Subject: [PATCH 2/8] Use correct background colour for sections --- osu.Game/Overlays/Profile/ProfileSection.cs | 68 +++++++++++---------- osu.Game/Overlays/UserProfileOverlay.cs | 2 +- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index 4d891384e8..fd51efba7b 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -8,18 +9,17 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Users; -using osuTK; -using osuTK.Graphics; namespace osu.Game.Overlays.Profile { - public abstract class ProfileSection : FillFlowContainer + public abstract class ProfileSection : Container { public abstract string Title { get; } public abstract string Identifier { get; } private readonly FillFlowContainer content; + private readonly Box background; protected override Container Content => content; @@ -27,50 +27,52 @@ namespace osu.Game.Overlays.Profile protected ProfileSection() { - Direction = FillDirection.Vertical; AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; + InternalChildren = new Drawable[] { - new OsuSpriteText + background = new Box { - Text = Title, - Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular, italics: true), - Margin = new MarginPadding - { - Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, - Vertical = 10 - } + RelativeSizeAxes = Axes.Both, }, - content = new FillFlowContainer + new FillFlowContainer { Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Padding = new MarginPadding + Children = new Drawable[] { - Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, - Bottom = 20 - } - }, - new Box - { - RelativeSizeAxes = Axes.X, - Height = 1, - Colour = OsuColour.Gray(34), - EdgeSmoothness = new Vector2(1) + new OsuSpriteText + { + Text = Title, + Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular, italics: true), + Margin = new MarginPadding + { + Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, + Vertical = 10 + } + }, + content = new FillFlowContainer + { + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Padding = new MarginPadding + { + Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, + Bottom = 20 + } + }, + }, } }; + } - // placeholder - Add(new OsuSpriteText - { - Text = @"coming soon!", - Colour = Color4.Gray, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Margin = new MarginPadding { Top = 100, Bottom = 100 } - }); + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + background.Colour = colours.GreySeafoamDarker; } } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index f712509702..3809a5af16 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -66,7 +66,7 @@ namespace osu.Game.Overlays Add(new Box { RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(0.2f) + Colour = OsuColour.Gray(0.1f) }); Add(sectionsContainer = new ProfileSectionsContainer From 4cd3b15f6ee81462f71290017f83f68c82a0b736 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 22 Jun 2019 02:40:33 +0300 Subject: [PATCH 3/8] Add triangles --- osu.Game/Overlays/Profile/ProfileSection.cs | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index fd51efba7b..8d1333b7ac 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -4,11 +4,14 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; +using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; using osu.Game.Users; +using osuTK.Graphics; namespace osu.Game.Overlays.Profile { @@ -36,6 +39,11 @@ namespace osu.Game.Overlays.Profile { RelativeSizeAxes = Axes.Both, }, + new SectionTriangles + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + }, new FillFlowContainer { Direction = FillDirection.Vertical, @@ -74,5 +82,42 @@ namespace osu.Game.Overlays.Profile { background.Colour = colours.GreySeafoamDarker; } + + private class SectionTriangles : Container + { + private readonly Triangles triangles; + private readonly Box foreground; + + public SectionTriangles() + { + RelativeSizeAxes = Axes.X; + Height = 100; + Masking = true; + Children = new Drawable[] + { + triangles = new Triangles + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.Both, + Height = 0.95f, + TriangleScale = 4, + Velocity = 0.5f, + }, + foreground = new Box + { + RelativeSizeAxes = Axes.Both, + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + triangles.ColourLight = colours.GreySeafoamDark; + triangles.ColourDark = colours.GreySeafoamDarker; + foreground.Colour = ColourInfo.GradientVertical(colours.GreySeafoamDarker, new Color4(0,0,0,0)); + } + } } } From 3723ea05de2b1222fbff6801e1ccb5d5c35a5b11 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 22 Jun 2019 02:52:07 +0300 Subject: [PATCH 4/8] Adjust Title style --- osu.Game/Overlays/Profile/ProfileSection.cs | 26 +++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index 8d1333b7ac..bdfdd44ac4 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -23,6 +23,7 @@ namespace osu.Game.Overlays.Profile private readonly FillFlowContainer content; private readonly Box background; + private readonly Box underscore; protected override Container Content => content; @@ -51,14 +52,30 @@ namespace osu.Game.Overlays.Profile RelativeSizeAxes = Axes.X, Children = new Drawable[] { - new OsuSpriteText + new Container { - Text = Title, - Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular, italics: true), + AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, - Vertical = 10 + Top = 15, + Bottom = 10, + }, + Children = new Drawable[] + { + new OsuSpriteText + { + Text = Title, + Font = OsuFont.GetFont(size: 20, weight: FontWeight.Bold), + }, + underscore = new Box + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.TopCentre, + Margin = new MarginPadding { Top = 4 }, + RelativeSizeAxes = Axes.X, + Height = 2, + } } }, content = new FillFlowContainer @@ -81,6 +98,7 @@ namespace osu.Game.Overlays.Profile private void load(OsuColour colours) { background.Colour = colours.GreySeafoamDarker; + underscore.Colour = colours.Seafoam; } private class SectionTriangles : Container From 4963d4e8df38e00929748fc6925e9b795af09e61 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 22 Jun 2019 03:08:18 +0300 Subject: [PATCH 5/8] CI fixes --- osu.Game/Overlays/Profile/ProfileSection.cs | 2 +- osu.Game/Overlays/UserProfileOverlay.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index bdfdd44ac4..84009f01ce 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -134,7 +134,7 @@ namespace osu.Game.Overlays.Profile { triangles.ColourLight = colours.GreySeafoamDark; triangles.ColourDark = colours.GreySeafoamDarker; - foreground.Colour = ColourInfo.GradientVertical(colours.GreySeafoamDarker, new Color4(0,0,0,0)); + foreground.Colour = ColourInfo.GradientVertical(colours.GreySeafoamDarker, new Color4(0, 0, 0, 0)); } } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 3809a5af16..9a5ba9e3c5 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -189,7 +189,7 @@ namespace osu.Game.Overlays } protected override FlowContainer CreateScrollContentContainer() - => new FillFlowContainer + => new FillFlowContainer { Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Y, From 1c20df780a10b6d4204082480506a25b2704f193 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 23 Jun 2019 17:08:18 +0300 Subject: [PATCH 6/8] Adjust triangles colour --- osu.Game/Overlays/Profile/ProfileSection.cs | 9 ++++----- osu.Game/Overlays/UserProfileOverlay.cs | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index 84009f01ce..688c26ec2e 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -3,6 +3,7 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; @@ -118,9 +119,7 @@ namespace osu.Game.Overlays.Profile Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.Both, - Height = 0.95f, - TriangleScale = 4, - Velocity = 0.5f, + TriangleScale = 3, }, foreground = new Box { @@ -133,8 +132,8 @@ namespace osu.Game.Overlays.Profile private void load(OsuColour colours) { triangles.ColourLight = colours.GreySeafoamDark; - triangles.ColourDark = colours.GreySeafoamDarker; - foreground.Colour = ColourInfo.GradientVertical(colours.GreySeafoamDarker, new Color4(0, 0, 0, 0)); + triangles.ColourDark = OsuColour.FromHex("171b1a"); + foreground.Colour = ColourInfo.GradientVertical(colours.GreySeafoamDarker, colours.GreySeafoamDarker.Opacity(0)); } } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 9a5ba9e3c5..8b2509bfdf 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -188,8 +188,7 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Both; } - protected override FlowContainer CreateScrollContentContainer() - => new FillFlowContainer + protected override FlowContainer CreateScrollContentContainer() => new FillFlowContainer { Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Y, From 8430ac6d1c33e7ea2b9a8d198fc200bf810894dd Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 23 Jun 2019 19:19:36 +0300 Subject: [PATCH 7/8] remove unused using --- osu.Game/Overlays/Profile/ProfileSection.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index 688c26ec2e..181b96666a 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -12,7 +12,6 @@ using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; using osu.Game.Users; -using osuTK.Graphics; namespace osu.Game.Overlays.Profile { From 5272b3a929975d0453b17d298b6ecf5b59d49ad7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 24 Jun 2019 13:27:58 +0900 Subject: [PATCH 8/8] Use .Darken() instead of hex-based colour --- osu.Game/Overlays/Profile/ProfileSection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index 181b96666a..f3590d4bb7 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -131,7 +131,7 @@ namespace osu.Game.Overlays.Profile private void load(OsuColour colours) { triangles.ColourLight = colours.GreySeafoamDark; - triangles.ColourDark = OsuColour.FromHex("171b1a"); + triangles.ColourDark = colours.GreySeafoamDarker.Darken(0.2f); foreground.Colour = ColourInfo.GradientVertical(colours.GreySeafoamDarker, colours.GreySeafoamDarker.Opacity(0)); } }