diff --git a/osu-framework b/osu-framework index 5a189d1050..2f0674792a 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 5a189d1050579b217bfe6b6c17c3ee6d6ef9c839 +Subproject commit 2f0674792adaf123dcf44ea0099c5707df4a6d60 diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 7ae45159d9..111dba7151 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -257,9 +257,15 @@ namespace osu.Game.Overlays.Settings.Sections.General private class UserDropdown : OsuEnumDropdown { - protected override DropdownHeader CreateHeader() => new UserDropdownHeader { AccentColour = AccentColour }; - protected override Menu CreateMenu() => new UserDropdownMenu(); - protected override DropdownMenuItem 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 CreateItemsFlow() + { + var flow = base.CreateItemsFlow(); + flow.Padding = new MarginPadding(0); + + return flow; + } + + protected override MenuItemRepresentation CreateMenuItemRepresentation(DropdownMenuItem model) => new UserDropdownMenuItem(this, model); + + private class UserDropdownMenuItem : OsuDropdownMenuItemRepresentation + { + public UserDropdownMenuItem(Menu> menu, DropdownMenuItem 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