mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Update LoginSettings in line with framework.
This commit is contained in:
@ -257,9 +257,15 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
|
||||
private class UserDropdown : OsuEnumDropdown<UserAction>
|
||||
{
|
||||
protected override DropdownHeader CreateHeader() => new UserDropdownHeader { AccentColour = AccentColour };
|
||||
protected override Menu CreateMenu() => new UserDropdownMenu();
|
||||
protected override DropdownMenuItem<UserAction> CreateMenuItem(string text, UserAction value) => new UserDropdownMenuItem(text, value) { AccentColour = AccentColour };
|
||||
protected override DropdownHeader CreateHeader()
|
||||
{
|
||||
var newHeader = new UserDropdownHeader();
|
||||
newHeader.AccentColour.BindTo(AccentColour);
|
||||
|
||||
return newHeader;
|
||||
}
|
||||
|
||||
protected override DropdownMenu CreateMenu() => new UserDropdownMenu();
|
||||
|
||||
public Color4 StatusColour
|
||||
{
|
||||
@ -274,7 +280,52 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
AccentColour = colours.Gray5;
|
||||
AccentColour.Value = colours.Gray5;
|
||||
}
|
||||
|
||||
private class UserDropdownMenu : OsuDropdownMenu
|
||||
{
|
||||
public UserDropdownMenu()
|
||||
{
|
||||
Masking = true;
|
||||
CornerRadius = 5;
|
||||
|
||||
Margin = new MarginPadding { Bottom = 5 };
|
||||
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.25f),
|
||||
Radius = 4,
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BackgroundColour = colours.Gray3;
|
||||
}
|
||||
|
||||
protected override FlowContainer<MenuItemRepresentation> CreateItemsFlow()
|
||||
{
|
||||
var flow = base.CreateItemsFlow();
|
||||
flow.Padding = new MarginPadding(0);
|
||||
|
||||
return flow;
|
||||
}
|
||||
|
||||
protected override MenuItemRepresentation CreateMenuItemRepresentation(DropdownMenuItem<UserAction> model) => new UserDropdownMenuItem(this, model);
|
||||
|
||||
private class UserDropdownMenuItem : OsuDropdownMenuItemRepresentation
|
||||
{
|
||||
public UserDropdownMenuItem(Menu<DropdownMenuItem<UserAction>> menu, DropdownMenuItem<UserAction> model)
|
||||
: base(menu, model)
|
||||
{
|
||||
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 };
|
||||
Label.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 };
|
||||
CornerRadius = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class UserDropdownHeader : OsuDropdownHeader
|
||||
@ -324,38 +375,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
}
|
||||
}
|
||||
|
||||
private class UserDropdownMenu : OsuMenu
|
||||
{
|
||||
public UserDropdownMenu()
|
||||
{
|
||||
Margin = new MarginPadding { Bottom = 5 };
|
||||
CornerRadius = 5;
|
||||
ItemsContainer.Padding = new MarginPadding(0);
|
||||
Masking = true;
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.25f),
|
||||
Radius = 4,
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Background.Colour = colours.Gray3;
|
||||
}
|
||||
}
|
||||
|
||||
private class UserDropdownMenuItem : OsuDropdownMenuItem
|
||||
{
|
||||
public UserDropdownMenuItem(string text, UserAction current) : base(text, current)
|
||||
{
|
||||
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 };
|
||||
Label.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 };
|
||||
CornerRadius = 5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private enum UserAction
|
||||
|
Reference in New Issue
Block a user