Merge pull request #90 from stecorb/fix-window-icon

Fix icon from showing up on certain window systems
This commit is contained in:
Preston 2020-08-22 13:51:40 -04:00 committed by GitHub
commit ea8b1d2f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ app.setName(productName)
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true' process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true'
// const gotTheLock = app.requestSingleInstanceLock() // const gotTheLock = app.requestSingleInstanceLock()
const path = require('path')
const isDev = process.env.NODE_ENV === 'development' const isDev = process.env.NODE_ENV === 'development'
const isDebug = process.argv.includes('--debug') const isDebug = process.argv.includes('--debug')
let mainWindow let mainWindow
@ -64,6 +65,9 @@ function createWindow () {
backgroundColor: '#fff', backgroundColor: '#fff',
width: 960, width: 960,
height: 540, height: 540,
icon: isDev
? path.join(__dirname, '../../_icons/iconColor.png')
: `${__dirname}/_icons/iconColor.png`,
autoHideMenuBar: true, autoHideMenuBar: true,
// useContentSize: true, // useContentSize: true,
webPreferences: { webPreferences: {
@ -84,7 +88,7 @@ function createWindow () {
} else { } else {
mainWindow.loadFile(`${__dirname}/index.html`) mainWindow.loadFile(`${__dirname}/index.html`)
global.__static = require('path') global.__static = path
.join(__dirname, '/static') .join(__dirname, '/static')
.replace(/\\/g, '\\\\') .replace(/\\/g, '\\\\')
} }