Adjust custom content item context menu options to be more visible on top

This commit is contained in:
2026-10-06 12:58:57 +02:00
parent 1e72e96015
commit ee9058f57f
2 changed files with 7 additions and 10 deletions
@@ -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);
}
+2 -2
View File
@@ -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;