Skip to content

Commit

Permalink
Fix icon in app on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
gianluca-pepe committed Jan 9, 2021
1 parent be85d81 commit 1449ffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Binary file added app/assets/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions app/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain , dialog} = require('electron')
const { app, BrowserWindow, ipcMain , dialog, nativeImage} = require('electron')
const fs = require('fs')
const path = require('path')

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
let gscapeWindow
const appIcon = nativeImage.createFromPath(path.resolve(__dirname, 'assets', 'icon-128.png'))

function createWindow () {
// Create the browser window.
Expand All @@ -17,6 +18,7 @@ function createWindow () {
webPreferences: {nodeIntegration: true},
autoHideMenuBar: true,
resizable: false,
icon: appIcon
})

// and load the index.html of the app.
Expand Down Expand Up @@ -64,6 +66,7 @@ function useGrapholscape(file) {
show: false,
webPreferences: {nodeIntegration: true},
autoHideMenuBar: true,
icon: appIcon
})

gscapeWindow.maximize()
Expand Down Expand Up @@ -114,7 +117,8 @@ function getFileString(grapholPath, callback) {
dialog.showMessageBox({
type: 'warning',
title: 'Warning',
message: 'Selected file does not exist, it will be removed from the list.'
message: 'Selected file does not exist, it will be removed from the list.',
buttons: ['OK'],
}).then( () => {
mainWindow.webContents.send('remove-recent', grapholPath)
})
Expand Down

0 comments on commit 1449ffe

Please sign in to comment.