mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-14 18:27:44 +02:00
parent
0e8f0a2dc1
commit
e462881502
@ -20,6 +20,8 @@ const getLabel = (commandName: string): string => {
|
||||
return _('Website and documentation');
|
||||
case 'hideApp':
|
||||
return _('Hide Joplin');
|
||||
case 'minimizeWindow':
|
||||
return _('Minimise');
|
||||
case 'closeWindow':
|
||||
return _('Close Window');
|
||||
case 'config':
|
||||
|
@ -843,6 +843,24 @@ function useMenu(props: Props) {
|
||||
label: _('&Tools'),
|
||||
submenu: toolsItems,
|
||||
},
|
||||
window: {
|
||||
id: 'window',
|
||||
|
||||
// Adds the default MacOS actions (e.g. "tile left") to the menu.
|
||||
//
|
||||
// Note: If the dev tools are shown on startup, this adds additional tab-related
|
||||
// actions to the menu that are not otherwise shown. See https://stackoverflow.com/a/77458809
|
||||
role: 'windowMenu',
|
||||
|
||||
label: _('&Window'),
|
||||
visible: !!shim.isMac(),
|
||||
submenu: [
|
||||
{
|
||||
role: 'minimize',
|
||||
accelerator: shim.isMac() && keymapService.getAccelerator('minimizeWindow'),
|
||||
},
|
||||
],
|
||||
},
|
||||
help: {
|
||||
label: _('&Help'),
|
||||
role: 'help', // Makes it add the "Search" field on macOS
|
||||
@ -946,6 +964,7 @@ function useMenu(props: Props) {
|
||||
}
|
||||
|
||||
const template = [
|
||||
shim.isMac() ? rootMenus.macOsApp : null,
|
||||
rootMenus.file,
|
||||
rootMenus.edit,
|
||||
rootMenus.view,
|
||||
@ -953,10 +972,9 @@ function useMenu(props: Props) {
|
||||
rootMenus.folder,
|
||||
rootMenus.note,
|
||||
rootMenus.tools,
|
||||
shim.isMac() ? rootMenus.window : null,
|
||||
rootMenus.help,
|
||||
];
|
||||
|
||||
if (shim.isMac()) template.splice(0, 0, rootMenus.macOsApp);
|
||||
].filter(item => item !== null);
|
||||
|
||||
if (props.routeName !== 'Main') {
|
||||
setMenu(Menu.buildFromTemplate([
|
||||
|
@ -20,6 +20,7 @@ const defaultKeymapItems = {
|
||||
{ accelerator: 'Cmd+Q', command: 'quit' },
|
||||
{ accelerator: 'Cmd+,', command: 'config' },
|
||||
{ accelerator: 'Cmd+W', command: 'closeWindow' },
|
||||
{ accelerator: 'Cmd+M', command: 'minimizeWindow' },
|
||||
{ accelerator: 'Cmd+C', command: 'textCopy' },
|
||||
{ accelerator: 'Cmd+X', command: 'textCut' },
|
||||
{ accelerator: 'Cmd+V', command: 'textPaste' },
|
||||
|
Loading…
Reference in New Issue
Block a user