diff --git a/osu-framework b/osu-framework index da5fbf8c58..5a189d1050 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit da5fbf8c580b079671298f6da54be10a00bf434c +Subproject commit 5a189d1050579b217bfe6b6c17c3ee6d6ef9c839 diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs index e597bc44b5..79519e26a0 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs @@ -5,28 +5,39 @@ using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; namespace osu.Game.Graphics.UserInterface { - public class OsuMenu : Menu + public class OsuMenu : Menu + where TItem : MenuItem { public OsuMenu() { CornerRadius = 4; - Background.Colour = Color4.Black.Opacity(0.5f); - - ItemsContainer.Padding = new MarginPadding(5); + BackgroundColour = Color4.Black.Opacity(0.5f); } protected override void AnimateOpen() => this.FadeIn(300, Easing.OutQuint); - protected override void AnimateClose() => this.FadeOut(300, Easing.OutQuint); - protected override void UpdateContentHeight() + protected override void UpdateMenuHeight() { var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight; this.ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, Easing.OutQuint); } + + protected override FlowContainer CreateItemsFlow() + { + var flow = base.CreateItemsFlow(); + flow.Padding = new MarginPadding(5); + + return flow; + } + } + + public class OsuMenu : OsuMenu + { } }