Added basic menu-bar and about window
This commit is contained in:
parent
8c9c50b586
commit
a821c2b00d
5 changed files with 127 additions and 14 deletions
14
app.js
14
app.js
|
|
@ -5,18 +5,22 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// Required packages
|
||||
const electron = require('electron')
|
||||
const contextMenu = require('electron-context-menu');
|
||||
const contextMenu = require('electron-context-menu')
|
||||
const path = require('path')
|
||||
|
||||
// Set up the app
|
||||
const app = electron.app
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
|
||||
const isDev = (process.env.NODE_ENV === 'DEV');
|
||||
|
||||
// Set the window content
|
||||
let url = `file://${path.join(__dirname, '/dist/index.html')}`
|
||||
let mainWindow
|
||||
|
||||
// Set the application menu
|
||||
require('./menu.js')
|
||||
|
||||
function createWindow() {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
|
|
@ -25,12 +29,10 @@ function createWindow() {
|
|||
icon: path.join(__dirname, '/icons/png/64x64.png')
|
||||
})
|
||||
|
||||
mainWindow.setMenu(null);
|
||||
|
||||
contextMenu({
|
||||
showCopyImageAddress: true,
|
||||
showSaveImageAs: true,
|
||||
showInspectElement: isDev,
|
||||
showInspectElement: false,
|
||||
});
|
||||
|
||||
mainWindow.loadURL(url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue