From d1f02538cbc764175532d66318a4083c95a63a4c Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 9 Oct 2017 21:12:04 +0300 Subject: [PATCH 1/3] Add tooltip to username in the profile overlay --- osu.Game/Overlays/Profile/ProfileHeader.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index d6a86fe714..742e865140 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -19,6 +19,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Users; using System.Diagnostics; using System.Globalization; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Overlays.Profile { @@ -119,7 +120,7 @@ namespace osu.Game.Overlays.Profile } } }, - new LinkFlowContainer.LinkText + new LinkFlowContainer.BrowserLinkText { Text = user.Username, Url = $@"https://osu.ppy.sh/users/{user.Id}", @@ -539,6 +540,11 @@ namespace osu.Game.Overlays.Profile hoverColour = colours.Yellow; } } + + public class BrowserLinkText : LinkText, IHasTooltip + { + public string TooltipText => "View Profile in Browser"; + } } } } From 82b333740d5d65d637c86bfe57ab8735514f6c58 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 11 Oct 2017 15:20:23 +0300 Subject: [PATCH 2/3] Apply suggestions --- osu.Game/Overlays/Profile/ProfileHeader.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 742e865140..3814fdcc18 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -120,15 +120,13 @@ namespace osu.Game.Overlays.Profile } } }, - new LinkFlowContainer.BrowserLinkText + new LinkFlowContainer.ProfileLink(user) { - Text = user.Username, - Url = $@"https://osu.ppy.sh/users/{user.Id}", - TextSize = 30, - Font = @"Exo2.0-RegularItalic", Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - Y = -48 + Y = -48, + TextSize = 30, + Font = @"Exo2.0-RegularItalic", }, countryFlag = new DrawableFlag(user.Country?.FlagName) { @@ -541,9 +539,15 @@ namespace osu.Game.Overlays.Profile } } - public class BrowserLinkText : LinkText, IHasTooltip + public class ProfileLink : LinkText, IHasTooltip { public string TooltipText => "View Profile in Browser"; + + public ProfileLink(User user) + { + Text = user.Username; + Url = $@"https://osu.ppy.sh/users/{user.Id}"; + } } } } From 070aceef1e5a2876d4b5d53e91b38e3b125d62df Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 13 Oct 2017 17:03:31 +0900 Subject: [PATCH 3/3] Move font and text size to class ProfileLink class --- osu.Game/Overlays/Profile/ProfileHeader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 3814fdcc18..337d4fe253 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -125,8 +125,6 @@ namespace osu.Game.Overlays.Profile Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Y = -48, - TextSize = 30, - Font = @"Exo2.0-RegularItalic", }, countryFlag = new DrawableFlag(user.Country?.FlagName) { @@ -547,6 +545,8 @@ namespace osu.Game.Overlays.Profile { Text = user.Username; Url = $@"https://osu.ppy.sh/users/{user.Id}"; + Font = @"Exo2.0-RegularItalic"; + TextSize = 30; } } }