Added app icon - platform independent.

This commit is contained in:
Daniel Scalzi
2017-04-22 20:59:26 -04:00
parent acffbec100
commit 9aa9ba7b1a
9 changed files with 3686 additions and 13 deletions

View File

@@ -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', () => {