Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update status icon design #22182

Merged
merged 4 commits into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions osu.Game/Overlays/Login/UserDropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Users.Drawables;
using osuTK;
using osuTK.Graphics;

Expand Down Expand Up @@ -78,7 +78,7 @@ private partial class UserDropdownHeader : OsuDropdownHeader
{
public const float LABEL_LEFT_MARGIN = 20;

private readonly SpriteIcon statusIcon;
private readonly StatusIcon statusIcon;

public Color4 StatusColour
{
Expand All @@ -101,11 +101,10 @@ public UserDropdownHeader()
Icon.Size = new Vector2(14);
Icon.Margin = new MarginPadding(0);

Foreground.Add(statusIcon = new SpriteIcon
Foreground.Add(statusIcon = new StatusIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Icon = FontAwesome.Regular.Circle,
Size = new Vector2(14),
});

Expand Down
26 changes: 26 additions & 0 deletions osu.Game/Users/Drawables/StatusIcon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osuTK;

namespace osu.Game.Users.Drawables
{
public partial class StatusIcon : CircularContainer
{
public StatusIcon()
{
Size = new Vector2(25);
BorderThickness = 4;
BorderColour = Colour4.White; // the colour is being applied through Colour - since it's multiplicative it applies to the border as well
Masking = true;
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Colour4.White.Opacity(0)
};
}
}
}
9 changes: 2 additions & 7 deletions osu.Game/Users/ExtendedUserPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Framework.Graphics.Sprites;
using osu.Game.Users.Drawables;
using osu.Framework.Input.Events;
using osu.Game.Online.API.Requests.Responses;
Expand All @@ -25,7 +24,7 @@ public abstract partial class ExtendedUserPanel : UserPanel

protected TextFlowContainer LastVisitMessage { get; private set; }

private SpriteIcon statusIcon;
private StatusIcon statusIcon;
private OsuSpriteText statusMessage;

protected ExtendedUserPanel(APIUser user)
Expand Down Expand Up @@ -59,11 +58,7 @@ protected override void LoadComplete()
Action = Action,
};

protected SpriteIcon CreateStatusIcon() => statusIcon = new SpriteIcon
{
Icon = FontAwesome.Regular.Circle,
Size = new Vector2(25)
};
protected Container CreateStatusIcon() => statusIcon = new StatusIcon();

protected FillFlowContainer CreateStatusMessage(bool rightAlignedChildren)
{
Expand Down