mirror of
https://github.com/ppy/osu
synced 2025-02-08 06:07:14 +00:00
Removed private OsuHoverContainer "content" from OsuLinkSpriteText for more customization.
This commit is contained in:
parent
4d475f1c1b
commit
bb0a32b555
@ -13,18 +13,12 @@ namespace osu.Game.Graphics.Sprites
|
||||
{
|
||||
public class OsuLinkSpriteText : OsuSpriteText
|
||||
{
|
||||
private readonly OsuClickableContainer content;
|
||||
|
||||
public override bool HandleInput => content.Action != null;
|
||||
|
||||
protected override Container<Drawable> Content => content ?? (Container<Drawable>)this;
|
||||
|
||||
protected override IEnumerable<Drawable> FlowingChildren => Children;
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
OnLinkClicked();
|
||||
return true;
|
||||
return base.OnClick(state);
|
||||
}
|
||||
|
||||
private string url;
|
||||
@ -42,14 +36,6 @@ namespace osu.Game.Graphics.Sprites
|
||||
}
|
||||
}
|
||||
|
||||
public OsuLinkSpriteText()
|
||||
{
|
||||
AddInternal(content = new OsuClickableContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
});
|
||||
}
|
||||
|
||||
public ColourInfo TextColour
|
||||
{
|
||||
get { return Content.Colour; }
|
||||
|
@ -17,6 +17,7 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Users;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
@ -490,8 +491,20 @@ namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
public string TooltipText => "View Profile in Browser";
|
||||
|
||||
private readonly OsuHoverContainer content;
|
||||
|
||||
protected override Container<Drawable> Content => content ?? (Container<Drawable>)this;
|
||||
|
||||
public override bool HandleInput => true;
|
||||
|
||||
public ProfileLink(User user)
|
||||
{
|
||||
AddInternal(content = new OsuHoverContainer
|
||||
{
|
||||
Action = OnLinkClicked,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
});
|
||||
|
||||
Text = user.Username;
|
||||
Url = $@"https://osu.ppy.sh/users/{user.Id}";
|
||||
Font = @"Exo2.0-RegularItalic";
|
||||
|
Loading…
Reference in New Issue
Block a user