diff --git a/src/SharpIDE.Godot/Features/Common/TreeItemContainer.cs.uid b/src/SharpIDE.Godot/Features/Common/TreeItemContainer.cs.uid new file mode 100644 index 0000000..9d65947 --- /dev/null +++ b/src/SharpIDE.Godot/Features/Common/TreeItemContainer.cs.uid @@ -0,0 +1 @@ +uid://c3k4fos7lp7oa diff --git a/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FileContextMenu.cs b/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FileContextMenu.cs index dcf2495..61de879 100644 --- a/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FileContextMenu.cs +++ b/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FileContextMenu.cs @@ -30,7 +30,7 @@ public partial class SolutionExplorerPanel } else if (actionId is FileContextMenuOptions.RevealInFileExplorer) { - OS.ShellOpen(Path.GetDirectoryName(file.Path)!); + OS.ShellShowInFileManager(file.Path); } else if (actionId is FileContextMenuOptions.CopyFullPath) { diff --git a/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FolderContextMenu.cs b/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FolderContextMenu.cs index c133d42..db4b674 100644 --- a/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FolderContextMenu.cs +++ b/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/FolderContextMenu.cs @@ -5,7 +5,14 @@ namespace SharpIDE.Godot.Features.SolutionExplorer; file enum FolderContextMenuOptions { - RevealInFileExplorer = 1 + CreateNew = 1, + RevealInFileExplorer = 2 +} + +file enum CreateNewSubmenuOptions +{ + Directory = 1, + CSharpFile = 2 } public partial class SolutionExplorerPanel @@ -14,6 +21,13 @@ public partial class SolutionExplorerPanel { var menu = new PopupMenu(); AddChild(menu); + + var createNewSubmenu = new PopupMenu(); + menu.AddSubmenuNodeItem("Add", createNewSubmenu, (int)FolderContextMenuOptions.CreateNew); + createNewSubmenu.AddItem("Directory", (int)CreateNewSubmenuOptions.Directory); + createNewSubmenu.AddItem("C# File", (int)CreateNewSubmenuOptions.CSharpFile); + createNewSubmenu.IdPressed += OnCreateNewSubmenuPressed; + menu.AddItem("Reveal in File Explorer", (int)FolderContextMenuOptions.RevealInFileExplorer); menu.PopupHide += () => menu.QueueFree(); menu.IdPressed += id => @@ -29,4 +43,17 @@ public partial class SolutionExplorerPanel menu.Position = new Vector2I((int)globalMousePosition.X, (int)globalMousePosition.Y); menu.Popup(); } + + private void OnCreateNewSubmenuPressed(long id) + { + var actionId = (CreateNewSubmenuOptions)id; + if (actionId is CreateNewSubmenuOptions.Directory) + { + //OpenCreateNewFolderDialog(folder); + } + else if (actionId is CreateNewSubmenuOptions.CSharpFile) + { + //OpenCreateNewCSharpFileDialog(folder); + } + } } \ No newline at end of file