From 10f0af1efa606c12951d1806a90477cbc3e22aa6 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 21 Jun 2022 10:31:47 +0800 Subject: [PATCH] * Update app menu to add item for new window (#2306) with keyboard shortcut --- src/main/index.js | 16 +++++++++++++++- static/locales/en-US.yaml | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/index.js b/src/main/index.js index ccac63ae..394a7c16 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -770,7 +770,21 @@ function runApp() { const template = [ { label: 'File', - submenu: [{ role: 'quit' }] + submenu: [ + { + label: 'New Window', + accelerator: 'CmdOrCtrl+N', + click: (_menuItem, _browserWindow, _event) => { + createWindow({ + replaceMainWindow: false, + showWindowNow: true + }) + }, + type: 'normal' + }, + { type: 'separator' }, + { role: 'quit' } + ] }, { label: 'Edit', diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index f47df3ad..e5eac17d 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -7,6 +7,7 @@ FreeTube: FreeTube # Webkit Menu Bar File: File +New Window: New Window Quit: Quit Edit: Edit Undo: Undo