From ee9058f57f7dc6f9a3339fc2f5ae568a36a13946 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 6 Oct 2026 12:58:57 +0200 Subject: [PATCH] Adjust custom content item context menu options to be more visible on top --- Source/Editor/Windows/ContentWindow.ContextMenu.cs | 13 +++++-------- Source/Editor/Windows/Search/SearchItem.cs | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Source/Editor/Windows/ContentWindow.ContextMenu.cs b/Source/Editor/Windows/ContentWindow.ContextMenu.cs index 22ef54bad..1865e6214 100644 --- a/Source/Editor/Windows/ContentWindow.ContextMenu.cs +++ b/Source/Editor/Windows/ContentWindow.ContextMenu.cs @@ -90,8 +90,12 @@ namespace FlaxEditor.Windows }); } + // Custom options + ContextMenuShow?.Invoke(cm, item); + proxy?.OnContentWindowContextMenu(cm, item); + item.OnContextMenu(cm); + cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(item.Path))); - if (!_showAllContentInTree && !String.IsNullOrEmpty(Editor.Instance.Windows.ContentWin._itemsSearchBox.Text)) { cm.AddButton("Show in Content Panel", () => @@ -180,13 +184,7 @@ namespace FlaxEditor.Windows cm.AddButton("Rename", () => Rename(item)); } - // Custom options - ContextMenuShow?.Invoke(cm, item); - proxy?.OnContentWindowContextMenu(cm, item); - item.OnContextMenu(cm); - cm.AddButton("Copy name to Clipboard", () => Clipboard.Text = item.NamePath); - cm.AddButton("Copy path to Clipboard", () => Clipboard.Text = item.Path); } else @@ -197,7 +195,6 @@ namespace FlaxEditor.Windows b.Enabled = _view.CanPaste(); cm.AddButton("Refresh", () => Editor.ContentDatabase.RefreshFolder(CurrentViewFolder, true)); - cm.AddButton("Refresh all thumbnails", RefreshViewItemsThumbnails); } diff --git a/Source/Editor/Windows/Search/SearchItem.cs b/Source/Editor/Windows/Search/SearchItem.cs index 63263cc58..1d3719947 100644 --- a/Source/Editor/Windows/Search/SearchItem.cs +++ b/Source/Editor/Windows/Search/SearchItem.cs @@ -190,6 +190,8 @@ namespace FlaxEditor.Windows.Search ContextMenuButton b; var cm = new ContextMenu { Tag = contentItem }; b = cm.AddButton("Open", () => Editor.Instance.ContentFinding.Open(Item)); + proxy?.OnContentWindowContextMenu(cm, contentItem); + contentItem.OnContextMenu(cm); cm.AddSeparator(); cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(contentItem.Path))); cm.AddButton("Show in Content window", () => Editor.Instance.Windows.ContentWin.Select(contentItem, true)); @@ -213,8 +215,6 @@ namespace FlaxEditor.Windows.Search cm.AddButton("Copy path to Clipboard", () => Clipboard.Text = assetItem.Path); cm.AddSeparator(); } - proxy?.OnContentWindowContextMenu(cm, contentItem); - contentItem.OnContextMenu(cm); cm.Show(this, location); _cm = cm; return true;