1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Remove most custom styling of user dropdown

This commit is contained in:
Joseph Madamba 2023-06-25 12:46:00 -07:00
parent 6ebc2581c2
commit ccc4d16096
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76

View File

@ -31,27 +31,6 @@ namespace osu.Game.Overlays.Login
protected partial class UserDropdownMenu : OsuDropdownMenu protected partial class UserDropdownMenu : OsuDropdownMenu
{ {
public UserDropdownMenu()
{
Masking = true;
CornerRadius = 5;
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f),
Radius = 4,
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
BackgroundColour = colours.Gray3;
SelectionColour = colours.Gray4;
HoverColour = colours.Gray5;
}
protected override DrawableDropdownMenuItem CreateDrawableDropdownMenuItem(MenuItem item) => new DrawableUserDropdownMenuItem(item); protected override DrawableDropdownMenuItem CreateDrawableDropdownMenuItem(MenuItem item) => new DrawableUserDropdownMenuItem(item);
private partial class DrawableUserDropdownMenuItem : DrawableOsuDropdownMenuItem private partial class DrawableUserDropdownMenuItem : DrawableOsuDropdownMenuItem
@ -60,20 +39,12 @@ namespace osu.Game.Overlays.Login
: base(item) : base(item)
{ {
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 }; Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 };
CornerRadius = 5;
} }
protected override Drawable CreateContent() => new Content
{
Label = { Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 } }
};
} }
} }
private partial class UserDropdownHeader : OsuDropdownHeader private partial class UserDropdownHeader : OsuDropdownHeader
{ {
public const float LABEL_LEFT_MARGIN = 20;
private readonly StatusIcon statusIcon; private readonly StatusIcon statusIcon;
public Color4 StatusColour public Color4 StatusColour
@ -83,19 +54,6 @@ namespace osu.Game.Overlays.Login
public UserDropdownHeader() public UserDropdownHeader()
{ {
Foreground.Padding = new MarginPadding { Left = 10, Right = 10 };
Masking = true;
CornerRadius = 5;
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f),
Radius = 4,
};
Icon.Size = new Vector2(14);
Icon.Margin = new MarginPadding(0);
Foreground.Add(statusIcon = new StatusIcon Foreground.Add(statusIcon = new StatusIcon
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
@ -103,14 +61,7 @@ namespace osu.Game.Overlays.Login
Size = new Vector2(14), Size = new Vector2(14),
}); });
Text.Margin = new MarginPadding { Left = LABEL_LEFT_MARGIN }; Text.Margin = new MarginPadding { Left = 20 };
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
BackgroundColour = colours.Gray3;
BackgroundColourHover = colours.Gray5;
} }
} }
} }