mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Set default app window icon on Linux
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const {app, BrowserWindow} = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
var mainWindow = null
|
||||
let mainWindow = null
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', () => {
|
||||
@@ -9,13 +10,18 @@ app.on('window-all-closed', () => {
|
||||
|
||||
exports.load = (appUrl) => {
|
||||
app.on('ready', () => {
|
||||
mainWindow = new BrowserWindow({
|
||||
const options = {
|
||||
width: 800,
|
||||
height: 600,
|
||||
autoHideMenuBar: true,
|
||||
backgroundColor: '#FFFFFF',
|
||||
useContentSize: true
|
||||
})
|
||||
}
|
||||
if (process.platform === 'linux') {
|
||||
options.icon = path.join(__dirname, 'icon.png')
|
||||
}
|
||||
|
||||
mainWindow = new BrowserWindow(options)
|
||||
mainWindow.loadURL(appUrl)
|
||||
mainWindow.focus()
|
||||
})
|
||||
|
||||
BIN
default_app/icon.png
Normal file
BIN
default_app/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 299 KiB |
@@ -75,6 +75,7 @@
|
||||
],
|
||||
'default_app_sources': [
|
||||
'default_app/default_app.js',
|
||||
'default_app/icon.png',
|
||||
'default_app/index.html',
|
||||
'default_app/main.js',
|
||||
'default_app/package.json',
|
||||
|
||||
Reference in New Issue
Block a user