double click to edit subtree
This commit is contained in:
1 parent
6b5abae6a3
commit
fed08a0f45
9 files changed
+176
-108
No files matched your search
@@ -18,12 +18,18 @@ export class MainProcess {
|
||||
nativeTheme.themeSource = "dark";
|
||||
app.on("ready", () => {
|
||||
this.createWindow();
|
||||
electronLocalshortcut.register(this.mainWindow, "CommandOrControl+C", () => {
|
||||
this.registerShortcut("CmdOrCtrl+C", () => {
|
||||
this.mainWindow.webContents.send(MainEventType.COPY_NODE);
|
||||
});
|
||||
electronLocalshortcut.register(this.mainWindow, "CommandOrControl+V", () => {
|
||||
this.registerShortcut("CmdOrCtrl+V", () => {
|
||||
this.mainWindow.webContents.send(MainEventType.PASTE_NODE);
|
||||
});
|
||||
this.registerShortcut("CmdOrCtrl+Z", () => {
|
||||
this.mainWindow.webContents.send(MainEventType.UNDO);
|
||||
});
|
||||
this.registerShortcut(process.platform === "darwin" ? "Cmd+Shift+Z" : "ctrl+y", () => {
|
||||
this.mainWindow.webContents.send(MainEventType.REDO);
|
||||
});
|
||||
});
|
||||
app.on("window-all-closed", () => {
|
||||
if (process.platform !== "darwin") {
|
||||
@@ -37,6 +43,10 @@ export class MainProcess {
|
||||
});
|
||||
}
|
||||
|
||||
registerShortcut(accelerator: string | string[], callback: () => void) {
|
||||
electronLocalshortcut.register(this.mainWindow, accelerator, callback);
|
||||
}
|
||||
|
||||
createWindow() {
|
||||
this.settings = new Settings();
|
||||
global.settings = this.settings;
|
||||
|
||||
Reference in new issue
Block a user