mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 22:43:58 +00:00
Merge pull request #674 from KKishikawa/fix-mac-select-all-shotcut
fix: Mac - shortcut for select all
This commit is contained in:
@@ -229,6 +229,9 @@ ipcMain.on('window-action', async (event, arg) => {
|
|||||||
case 'paste':
|
case 'paste':
|
||||||
mainWindow.webContents.paste();
|
mainWindow.webContents.paste();
|
||||||
break;
|
break;
|
||||||
|
case 'selectAll':
|
||||||
|
mainWindow.webContents.selectAll();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ module.exports = ({ editMenu }) => [
|
|||||||
{ command: 'edit.cut' },
|
{ command: 'edit.cut' },
|
||||||
{ command: 'edit.copy' },
|
{ command: 'edit.copy' },
|
||||||
{ command: 'edit.paste' },
|
{ command: 'edit.paste' },
|
||||||
|
{ command: 'edit.selectAll' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -835,6 +835,16 @@ registerCommand({
|
|||||||
onClick: () => getElectron().send('window-action', 'paste'),
|
onClick: () => getElectron().send('window-action', 'paste'),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
registerCommand({
|
||||||
|
id: 'edit.selectAll',
|
||||||
|
category: 'Edit',
|
||||||
|
name: 'Select All',
|
||||||
|
keyText: 'CtrlOrCommand+A',
|
||||||
|
systemCommand: true,
|
||||||
|
testEnabled: () => getElectron() != null,
|
||||||
|
onClick: () => getElectron().send('window-action', 'selectAll'),
|
||||||
|
});
|
||||||
|
|
||||||
const electron = getElectron();
|
const electron = getElectron();
|
||||||
if (electron) {
|
if (electron) {
|
||||||
electron.addEventListener('run-command', (e, commandId) => runCommand(commandId));
|
electron.addEventListener('run-command', (e, commandId) => runCommand(commandId));
|
||||||
|
|||||||
Reference in New Issue
Block a user