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
1 changed files with 20 additions and 0 deletions

View File

@ -110,11 +110,31 @@ protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item)
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)