Browse Source

Amélioration menu

Arthur Brandao 5 years ago
parent
commit
aa7d4880a5
3 changed files with 12 additions and 5 deletions
  1. 2 5
      app/main/application-menu.js
  2. 4 0
      app/main/context-menu.js
  3. 6 0
      app/main/function/menu.js

+ 2 - 5
app/main/application-menu.js

@@ -20,6 +20,7 @@ let template = [
       },
       {
         label: 'Reset',
+        accelerator: 'CmdOrCtrl+R',
         click: () => {
           mainWindow.webContents.send('reset-app');
         }
@@ -83,11 +84,7 @@ let template = [
             return 'Ctrl+Shift+I'
           }
         })(),
-        click: (item, focusedWindow) => {
-          if (focusedWindow) {
-            focusedWindow.toggleDevTools()
-          }
-        }
+        click: func.devTool
       }
     ]
   },

+ 4 - 0
app/main/context-menu.js

@@ -25,6 +25,10 @@ menu.append(new MenuItem({
         mainWindow.webContents.send('app-loader');
     }
 }));
+menu.append(new MenuItem({
+    label: 'Outils Developpeur',
+    click: func.devTool
+}))
 
 app.on('browser-window-created', (event, win) => {
     win.webContents.on('context-menu', (evt, params) => {

+ 6 - 0
app/main/function/menu.js

@@ -8,4 +8,10 @@ menuFunction.import = function() {
     console.log('Import');
 }
 
+menuFunction.devTool = function (item, focusedWindow) {
+    if (focusedWindow) {
+        focusedWindow.toggleDevTools()
+    }
+}
+
 module.exports = menuFunction;