mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Remove most custom styling of user dropdown
This commit is contained in:
parent
6ebc2581c2
commit
ccc4d16096
@ -31,27 +31,6 @@ namespace osu.Game.Overlays.Login
|
||||
|
||||
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);
|
||||
|
||||
private partial class DrawableUserDropdownMenuItem : DrawableOsuDropdownMenuItem
|
||||
@ -60,20 +39,12 @@ namespace osu.Game.Overlays.Login
|
||||
: base(item)
|
||||
{
|
||||
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
|
||||
{
|
||||
public const float LABEL_LEFT_MARGIN = 20;
|
||||
|
||||
private readonly StatusIcon statusIcon;
|
||||
|
||||
public Color4 StatusColour
|
||||
@ -83,19 +54,6 @@ namespace osu.Game.Overlays.Login
|
||||
|
||||
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
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
@ -103,14 +61,7 @@ namespace osu.Game.Overlays.Login
|
||||
Size = new Vector2(14),
|
||||
});
|
||||
|
||||
Text.Margin = new MarginPadding { Left = LABEL_LEFT_MARGIN };
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BackgroundColour = colours.Gray3;
|
||||
BackgroundColourHover = colours.Gray5;
|
||||
Text.Margin = new MarginPadding { Left = 20 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user