From 4ab209bdce8a5fbc234c6bf899e62a9c8290db5b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 24 Aug 2017 19:05:51 +0900 Subject: [PATCH] Add EditorContextMenu in line with framework changes To avoid public Menu. --- osu-framework | 2 +- osu.Desktop.Tests/Visual/TestCaseEditorMenuBar.cs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/osu-framework b/osu-framework index fbbcd942e2..a5fd0c82c8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit fbbcd942e262778b166acde2cc89a10782734f2d +Subproject commit a5fd0c82c8f86d41c80ac1b0b07727cb312330f1 diff --git a/osu.Desktop.Tests/Visual/TestCaseEditorMenuBar.cs b/osu.Desktop.Tests/Visual/TestCaseEditorMenuBar.cs index 49a382c9f9..7a9c97f5d5 100644 --- a/osu.Desktop.Tests/Visual/TestCaseEditorMenuBar.cs +++ b/osu.Desktop.Tests/Visual/TestCaseEditorMenuBar.cs @@ -126,7 +126,6 @@ public EditorMenuBarItem(string title) private void load(OsuColour colours) { background.Colour = colours.Gray3; - ContextMenu.Menu.Background.Colour = colours.Gray3; TitleText.Colour = normalColour = colours.BlueLight; } @@ -148,12 +147,21 @@ public override void Close() protected override SpriteText CreateTitleText() => new OsuSpriteText { TextSize = text_size }; - protected override ContextMenu CreateContextMenu() => new OsuContextMenu + protected override ContextMenu CreateContextMenu() => new EditorContextMenu { OriginPosition = new Vector2(8, 0) }; } + private class EditorContextMenu : OsuContextMenu + { + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + Menu.Background.Colour = colours.Gray3; + } + } + private class EditorContextMenuSpacer : EditorContextMenuItem { public override bool HandleInput => false;