1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Merge pull request #18432 from Joehuu/fix-editor-menu-item-checks

Fix checkmarks not showing on editor stateful menu items
This commit is contained in:
Dean Herbert 2022-05-27 14:16:42 +09:00 committed by GitHub
commit 27cb9d1ead
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)