Browse Source

ADD: Context menu - always show "New->Directory" and "New->File" menu items (fixes #559)

Alexander Koblov 3 years ago
parent
commit
ec855c4d0f
1 changed files with 22 additions and 15 deletions
  1. 22 15
      src/platform/unix/ushellcontextmenu.pas

+ 22 - 15
src/platform/unix/ushellcontextmenu.pas

@@ -3,7 +3,7 @@
     -------------------------------------------------------------------------
     Shell context menu implementation.
 
-    Copyright (C) 2006-2017 Alexander Koblov ([email protected])
+    Copyright (C) 2006-2022 Alexander Koblov ([email protected])
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -880,23 +880,30 @@ begin
       mi.Action := frmMain.actPasteFromClipboard;
       Self.Items.Add(mi);
 
-      if GetTemplateMenu(sl) then
-      begin
-        mi:=TMenuItem.Create(Self);
-        mi.Caption:='-';
-        Self.Items.Add(mi);
 
-        // Add "New" submenu
-        miSortBy := TMenuItem.Create(Self);
-        miSortBy.Caption := rsMnuNew;
-        Self.Items.Add(miSortBy);
+      mi:=TMenuItem.Create(Self);
+      mi.Caption:='-';
+      Self.Items.Add(mi);
 
-        // Add "Make directory"
-        mi:= TMenuItem.Create(miSortBy);
-        mi.Action := frmMain.actMakeDir;
-        mi.Caption:= rsPropsFolder;
-        miSortBy.Add(mi);
+      // Add "New" submenu
+      miSortBy := TMenuItem.Create(Self);
+      miSortBy.Caption := rsMnuNew;
+      Self.Items.Add(miSortBy);
+
+      // Add "Create directory"
+      mi:= TMenuItem.Create(miSortBy);
+      mi.Action := frmMain.actMakeDir;
+      mi.Caption:= rsPropsFolder;
+      miSortBy.Add(mi);
 
+      // Add "Create file"
+      mi:= TMenuItem.Create(miSortBy);
+      mi.Action := frmMain.actEditNew;
+      mi.Caption:= rsPropsFile;
+      miSortBy.Add(mi);
+
+      if GetTemplateMenu(sl) then
+      begin
         mi:= TMenuItem.Create(miSortBy);
         mi.Caption:= '-';
         miSortBy.Add(mi);