Added app icon - platform independent.
This commit is contained in:
16
index.js
16
index.js
@@ -7,7 +7,7 @@ const url = require('url')
|
||||
let win
|
||||
|
||||
function createWindow() {
|
||||
win = new BrowserWindow({ width: 925, height: 500 })
|
||||
win = new BrowserWindow({ width: 925, height: 500, icon: getPlatformIcon('WesterosSealSquare')})
|
||||
|
||||
win.loadURL(url.format({
|
||||
pathname: path.join(__dirname, 'app', 'index.html'),
|
||||
@@ -15,8 +15,6 @@ function createWindow() {
|
||||
slashes: true
|
||||
}))
|
||||
|
||||
//Open DevTools, this will be removed on release.
|
||||
win.webContents.openDevTools()
|
||||
win.setMenu(null)
|
||||
|
||||
win.on('closed', () => {
|
||||
@@ -24,6 +22,18 @@ function createWindow() {
|
||||
})
|
||||
}
|
||||
|
||||
function getPlatformIcon(filename){
|
||||
if (process.platform === 'darwin') {
|
||||
filename = filename + '.icns'
|
||||
} else if (process.platform === 'win32') {
|
||||
filename = filename + '.ico'
|
||||
} else {
|
||||
filename = filename + '.png'
|
||||
}
|
||||
|
||||
return path.join(__dirname, 'app', 'assets', 'images', filename)
|
||||
}
|
||||
|
||||
app.on('ready', createWindow);
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
||||
Reference in New Issue
Block a user