@@ -135,76 +135,140 @@ export const setMainMenu = ({ mainWindow, menuData, enabled = false }: MainMenuA
135
135
isMac ? { role : 'close' , enabled } : { role : 'quit' , enabled } ,
136
136
] ,
137
137
} ,
138
- {
139
- label : 'Edit' ,
140
- submenu : [
141
- {
142
- label : 'Undo' ,
143
- accelerator : 'CmdOrCtrl+Z' ,
144
- registerAccelerator : false ,
145
- click : ( ) => {
146
- mainWindow . webContents . send ( 'history-undo' ) ;
147
- } ,
148
- enabled,
149
- } ,
150
- {
151
- label : 'Redo' ,
152
- accelerator : 'CmdOrCtrl+Y' ,
153
- registerAccelerator : false ,
154
- click : ( ) => {
155
- mainWindow . webContents . send ( 'history-redo' ) ;
156
- } ,
157
- enabled,
158
- } ,
159
- { type : 'separator' } ,
160
- {
161
- label : 'Cut' ,
162
- accelerator : 'CmdOrCtrl+X' ,
163
- registerAccelerator : false ,
164
- click : ( ) => {
165
- mainWindow . webContents . send ( 'cut' ) ;
166
- } ,
167
- enabled,
168
- } ,
169
- {
170
- label : 'Copy' ,
171
- accelerator : 'CmdOrCtrl+C' ,
172
- registerAccelerator : false ,
173
- click : ( ) => {
174
- mainWindow . webContents . send ( 'copy' ) ;
175
- } ,
176
- enabled,
177
- } ,
178
- {
179
- label : 'Paste' ,
180
- accelerator : 'CmdOrCtrl+V' ,
181
- registerAccelerator : false ,
182
- click : ( ) => {
183
- mainWindow . webContents . send ( 'paste' ) ;
184
- } ,
185
- enabled,
186
- } ,
187
- { type : 'separator' } ,
188
- {
189
- label : 'Duplicate' ,
190
- accelerator : 'CmdOrCtrl+D' ,
191
- registerAccelerator : false ,
192
- click : ( ) => {
193
- mainWindow . webContents . send ( 'duplicate' ) ;
194
- } ,
195
- enabled,
196
- } ,
197
- {
198
- label : 'Duplicate with Connections' ,
199
- accelerator : 'CmdOrCtrl+Shift+D' ,
200
- registerAccelerator : false ,
201
- click : ( ) => {
202
- mainWindow . webContents . send ( 'duplicate-with-input-edges' ) ;
203
- } ,
204
- enabled,
205
- } ,
206
- ] ,
207
- } ,
138
+ ...( isMac
139
+ ? [
140
+ { role : 'editMenu' } ,
141
+ {
142
+ label : 'Nodes' ,
143
+ submenu : [
144
+ {
145
+ label : 'Undo' ,
146
+ click : ( ) => {
147
+ mainWindow . webContents . send ( 'history-undo' ) ;
148
+ } ,
149
+ enabled,
150
+ } ,
151
+ {
152
+ label : 'Redo' ,
153
+ click : ( ) => {
154
+ mainWindow . webContents . send ( 'history-redo' ) ;
155
+ } ,
156
+ enabled,
157
+ } ,
158
+ { type : 'separator' } ,
159
+ {
160
+ label : 'Cut' ,
161
+ click : ( ) => {
162
+ mainWindow . webContents . send ( 'cut' ) ;
163
+ } ,
164
+ enabled,
165
+ } ,
166
+ {
167
+ label : 'Copy' ,
168
+ click : ( ) => {
169
+ mainWindow . webContents . send ( 'copy' ) ;
170
+ } ,
171
+ enabled,
172
+ } ,
173
+ {
174
+ label : 'Paste' ,
175
+ click : ( ) => {
176
+ mainWindow . webContents . send ( 'paste' ) ;
177
+ } ,
178
+ enabled,
179
+ } ,
180
+ { type : 'separator' } ,
181
+ {
182
+ label : 'Duplicate' ,
183
+ accelerator : 'CmdOrCtrl+D' ,
184
+ click : ( ) => {
185
+ mainWindow . webContents . send ( 'duplicate' ) ;
186
+ } ,
187
+ enabled,
188
+ } ,
189
+ {
190
+ label : 'Duplicate with Connections' ,
191
+ accelerator : 'CmdOrCtrl+Shift+D' ,
192
+ click : ( ) => {
193
+ mainWindow . webContents . send ( 'duplicate-with-input-edges' ) ;
194
+ } ,
195
+ enabled,
196
+ } ,
197
+ ] ,
198
+ } ,
199
+ ]
200
+ : [
201
+ {
202
+ label : 'Edit' ,
203
+ submenu : [
204
+ {
205
+ label : 'Undo' ,
206
+ accelerator : 'CmdOrCtrl+Z' ,
207
+ registerAccelerator : false ,
208
+ click : ( ) => {
209
+ mainWindow . webContents . send ( 'history-undo' ) ;
210
+ } ,
211
+ enabled,
212
+ } ,
213
+ {
214
+ label : 'Redo' ,
215
+ accelerator : 'CmdOrCtrl+Y' ,
216
+ registerAccelerator : false ,
217
+ click : ( ) => {
218
+ mainWindow . webContents . send ( 'history-redo' ) ;
219
+ } ,
220
+ enabled,
221
+ } ,
222
+ { type : 'separator' } ,
223
+ {
224
+ label : 'Cut' ,
225
+ accelerator : 'CmdOrCtrl+X' ,
226
+ registerAccelerator : false ,
227
+ click : ( ) => {
228
+ mainWindow . webContents . send ( 'cut' ) ;
229
+ } ,
230
+ enabled,
231
+ } ,
232
+ {
233
+ label : 'Copy' ,
234
+ accelerator : 'CmdOrCtrl+C' ,
235
+ registerAccelerator : false ,
236
+ click : ( ) => {
237
+ mainWindow . webContents . send ( 'copy' ) ;
238
+ } ,
239
+ enabled,
240
+ } ,
241
+ {
242
+ label : 'Paste' ,
243
+ accelerator : 'CmdOrCtrl+V' ,
244
+ registerAccelerator : false ,
245
+ click : ( ) => {
246
+ mainWindow . webContents . send ( 'paste' ) ;
247
+ } ,
248
+ enabled,
249
+ } ,
250
+ { type : 'separator' } ,
251
+ {
252
+ label : 'Duplicate' ,
253
+ accelerator : 'CmdOrCtrl+D' ,
254
+ registerAccelerator : false ,
255
+ click : ( ) => {
256
+ mainWindow . webContents . send ( 'duplicate' ) ;
257
+ } ,
258
+ enabled,
259
+ } ,
260
+ {
261
+ label : 'Duplicate with Connections' ,
262
+ accelerator : 'CmdOrCtrl+Shift+D' ,
263
+ registerAccelerator : false ,
264
+ click : ( ) => {
265
+ mainWindow . webContents . send ( 'duplicate-with-input-edges' ) ;
266
+ } ,
267
+ enabled,
268
+ } ,
269
+ ] ,
270
+ } ,
271
+ ] ) ,
208
272
{
209
273
label : 'View' ,
210
274
submenu : [
0 commit comments