mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
mac keyboard menu
This commit is contained in:
@@ -108,7 +108,7 @@ function commandItem(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildMenu() {
|
function buildMenu() {
|
||||||
let template = _cloneDeepWith(mainMenuDefinition({ editMenu: true }), item => {
|
let template = _cloneDeepWith(mainMenuDefinition({ editMenu: true, isMac: isMac() }), item => {
|
||||||
if (item.divider) {
|
if (item.divider) {
|
||||||
return { type: 'separator' };
|
return { type: 'separator' };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module.exports = ({ editMenu }) => [
|
module.exports = ({ editMenu, isMac }) => [
|
||||||
{
|
{
|
||||||
label: 'File',
|
label: 'File',
|
||||||
submenu: [
|
submenu: [
|
||||||
@@ -24,20 +24,6 @@ module.exports = ({ editMenu }) => [
|
|||||||
{ command: 'app.disconnect', hideDisabled: true, skipInApp: true },
|
{ command: 'app.disconnect', hideDisabled: true, skipInApp: true },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'Window',
|
|
||||||
submenu: [
|
|
||||||
{ command: 'tabs.closeTab', hideDisabled: false },
|
|
||||||
{ command: 'tabs.closeAll', hideDisabled: false },
|
|
||||||
{ command: 'tabs.closeTabsWithCurrentDb', hideDisabled: false },
|
|
||||||
{ command: 'tabs.closeTabsButCurrentDb', hideDisabled: false },
|
|
||||||
{ divider: true },
|
|
||||||
{ command: 'app.zoomIn', hideDisabled: true },
|
|
||||||
{ command: 'app.zoomOut', hideDisabled: true },
|
|
||||||
{ command: 'app.zoomReset', hideDisabled: true },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
editMenu
|
editMenu
|
||||||
? {
|
? {
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
@@ -75,6 +61,15 @@ module.exports = ({ editMenu }) => [
|
|||||||
{ divider: true },
|
{ divider: true },
|
||||||
{ command: 'theme.changeTheme', hideDisabled: true },
|
{ command: 'theme.changeTheme', hideDisabled: true },
|
||||||
{ command: 'settings.show' },
|
{ command: 'settings.show' },
|
||||||
|
{ divider: true },
|
||||||
|
{ command: 'tabs.closeTab', hideDisabled: false },
|
||||||
|
{ command: 'tabs.closeAll', hideDisabled: false },
|
||||||
|
{ command: 'tabs.closeTabsWithCurrentDb', hideDisabled: false },
|
||||||
|
{ command: 'tabs.closeTabsButCurrentDb', hideDisabled: false },
|
||||||
|
{ divider: true },
|
||||||
|
{ command: 'app.zoomIn', hideDisabled: true },
|
||||||
|
{ command: 'app.zoomOut', hideDisabled: true },
|
||||||
|
{ command: 'app.zoomReset', hideDisabled: true },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -94,6 +89,17 @@ module.exports = ({ editMenu }) => [
|
|||||||
{ command: 'app.resetSettings', hideDisabled: true },
|
{ command: 'app.resetSettings', hideDisabled: true },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
isMac
|
||||||
|
? {
|
||||||
|
role: 'window',
|
||||||
|
submenu: [
|
||||||
|
{ role: 'minimize' },
|
||||||
|
{ role: 'zoom' },
|
||||||
|
{ type: 'separator' },
|
||||||
|
{ role: 'front' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
: null,
|
||||||
{
|
{
|
||||||
label: 'Help',
|
label: 'Help',
|
||||||
submenu: [
|
submenu: [
|
||||||
|
|||||||
Reference in New Issue
Block a user