diff --git a/public/locales/en.json b/public/locales/en.json index 2a1048b..2fab162 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -7,6 +7,7 @@ "buildFailed": "Build failed, more information can be found in the console.", "cancel": "Cancel", "copy": "Copy", + "cut": "Cut", "createProject": "Create Project", "delete": "Delete", "deleteNode": "Delete Node", @@ -44,6 +45,7 @@ "saveAsSubtree": "Save As Subtree", "searchFile": "Search File", "searchNode": "Search Node", + "selectAll": "Select All", "services": "Services", "start": "Start", "undo": "Undo", diff --git a/public/locales/zh.json b/public/locales/zh.json index 51497a8..bc34304 100644 --- a/public/locales/zh.json +++ b/public/locales/zh.json @@ -7,6 +7,7 @@ "buildFailed": "构建出现错误,详情请查看控制台!", "cancel": "取消", "copy": "复制", + "cut": "替换", "createProject": "新建项目", "delete": "删除", "deleteNode": "删除节点", @@ -44,6 +45,7 @@ "saveAsSubtree": "另存为子树", "searchFile": "搜索文件", "searchNode": "搜索节点", + "selectAll": "全选", "services": "服务", "start": "开始", "undo": "撤销", diff --git a/src/components/menu.tsx b/src/components/menu.tsx index 389ab03..ea11d12 100644 --- a/src/components/menu.tsx +++ b/src/components/menu.tsx @@ -213,6 +213,24 @@ export const Menu: FC = () => { getFocusedWebContents()?.paste(); }, }, + { + id: 'menu.edit.cut', + label: t('cut'), + enabled: enabled, + accelerator: Hotkey.Cut, + click: () => { + getFocusedWebContents()?.cut() + } + }, + { + id: 'menu.edit.selectAll', + label: t('selectAll'), + enabled: enabled, + accelerator: Hotkey.SelectAll, + click: () => { + getFocusedWebContents()?.selectAll() + } + }, { type: "separator" }, { id: "menu.edit.insertNode", diff --git a/src/misc/keys.ts b/src/misc/keys.ts index c338797..1190e10 100644 --- a/src/misc/keys.ts +++ b/src/misc/keys.ts @@ -46,6 +46,7 @@ export const Hotkey = { Build: hotkey("ctrl+b"), CloseEditor: hotkey("ctrl+w"), Copy: hotkey("ctrl+c"), + Cut: hotkey('ctrl+x'), Delete: Key.Delete, Duplicate: hotkey("ctrl+d"), Enter: Key.Enter, @@ -60,6 +61,7 @@ export const Hotkey = { Save: hotkey("ctrl+s"), SearchTree: hotkey("ctrl+p"), SearchNode: hotkey("ctrl+f"), + SelectAll: hotkey('ctrl+a'), Undo: hotkey("ctrl+z"), };