From e551a536015a691297993eb5ce005c50e4d8f11a Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Thu, 26 May 2022 21:45:07 -0700 Subject: [PATCH] Fix checkmarks not showing on editor stateful menu items --- .../Edit/Components/Menus/EditorMenuBar.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs index 440071bc4c..20b8bba6da 100644 --- a/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs @@ -110,11 +110,31 @@ namespace osu.Game.Screens.Edit.Components.Menus case EditorMenuItemSpacer spacer: return new DrawableSpacer(spacer); + case StatefulMenuItem stateful: + return new EditorStatefulMenuItem(stateful); + default: return new EditorMenuItem(item); } } + private class EditorStatefulMenuItem : DrawableStatefulMenuItem + { + public EditorStatefulMenuItem(StatefulMenuItem item) + : base(item) + { + } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + BackgroundColour = colourProvider.Background2; + BackgroundColourHover = colourProvider.Background1; + + Foreground.Padding = new MarginPadding { Vertical = 2 }; + } + } + private class EditorMenuItem : DrawableOsuMenuItem { public EditorMenuItem(MenuItem item)