···1+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2+// See the LICENCE file in the repository root for full licence text.
3+4+using osu.Framework.Graphics.UserInterface;
5+6+namespace osu.Framework.Graphics.Cursor
7+{
8+ public class BasicContextMenuContainer : ContextMenuContainer
9+ {
10+ protected override Menu CreateMenu() => new BasicMenu(Direction.Vertical);
11+ }
12+}
+41
osu.Framework/Graphics/UserInterface/BasicMenu.cs
···00000000000000000000000000000000000000000
···1+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2+// See the LICENCE file in the repository root for full licence text.
3+4+using osu.Framework.Graphics.Sprites;
5+6+namespace osu.Framework.Graphics.UserInterface
7+{
8+ public class BasicMenu : Menu
9+ {
10+ public BasicMenu(Direction direction, bool topLevelMenu = false)
11+ : base(direction, topLevelMenu)
12+ {
13+ BackgroundColour = FrameworkColour.Blue;
14+ }
15+16+ protected override Menu CreateSubMenu() => new BasicMenu(Direction.Vertical)
17+ {
18+ Anchor = Direction == Direction.Horizontal ? Anchor.BottomLeft : Anchor.TopRight
19+ };
20+21+ protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new BasicDrawableMenuItem(item);
22+23+ public class BasicDrawableMenuItem : DrawableMenuItem
24+ {
25+ public BasicDrawableMenuItem(MenuItem item)
26+ : base(item)
27+ {
28+ BackgroundColour = FrameworkColour.BlueGreen;
29+ BackgroundColourHover = FrameworkColour.Green;
30+ }
31+32+ protected override Drawable CreateContent() => new SpriteText
33+ {
34+ Anchor = Anchor.CentreLeft,
35+ Origin = Anchor.CentreLeft,
36+ Padding = new MarginPadding(2),
37+ Font = new FontUsage("RobotoCondensed", weight: "Regular"),
38+ };
39+ }
40+ }
41+}