Add shortcuts to select next/previous tab

This commit is contained in:
Yuya Ochiai
2016-05-19 00:25:21 +09:00
parent 8f936c1725
commit 0bb56291ed
2 changed files with 31 additions and 3 deletions

View File

@@ -136,7 +136,8 @@ var createTemplate = function(mainWindow, config) {
}
}, ]
});
template.push({
const window_menu = {
label: '&Window',
submenu: [{
label: 'Minimize',
@@ -166,7 +167,27 @@ var createTemplate = function(mainWindow, config) {
}
};
})]
});
}
if (config.teams.length > 1) {
window_menu.submenu = window_menu.submenu.concat([{
type: 'separator'
}, {
label: 'Select Next Team',
accelerator: (process.platform === 'darwin') ? 'Alt+Cmd+Right' : 'CmdOrCtrl+Tab',
click: () => {
mainWindow.webContents.send('select-next-tab');
}
}, {
label: 'Select Previous Team',
accelerator: (process.platform === 'darwin') ? 'Alt+Cmd+Left' : 'CmdOrCtrl+Shift+Tab',
click: () => {
mainWindow.webContents.send('select-previous-tab');
}
}]);
}
template.push(window_menu);
return template;
};