feat: crossplatform icon config

This commit is contained in:
Amadou Ada DIENE
2021-07-21 17:55:49 +02:00
parent 7a3d5d7d3a
commit 4e9506aca5
8 changed files with 1108 additions and 19 deletions

1086
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -55,31 +55,21 @@
}, },
"config": { "config": {
"forge": { "forge": {
"packagerConfig": {}, "packagerConfig": {
"name": "electron-angular",
"icon": "./workspaces/electron-app/main/assets/icons/icon"
},
"makers": [ "makers": [
{ {
"name": "@electron-forge/maker-dmg", "name": "@electron-forge/maker-dmg",
"config": { "config": {}
"name": "EAQS"
}
},
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "electron_angular_quick_start"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": []
}, },
{ {
"name": "@electron-forge/maker-deb", "name": "@electron-forge/maker-deb",
"config": {} "config": {}
}, },
{ {
"name": "@electron-forge/maker-rpm", "name": "@electron-forge/maker-squirrel"
"config": {}
} }
], ],
"plugins": [ "plugins": [

View File

@@ -24,6 +24,6 @@
"mainLogFile": "main.log", "mainLogFile": "main.log",
"mainLogLevel": "error", "mainLogLevel": "error",
"isIconAvailable": false, "isIconAvailable": false,
"isOpenDevTools": true "isOpenDevTools": false
} }
} }

View File

@@ -0,0 +1,14 @@
# Install the icon generator globally
> npm i -g electron-icon-maker
# Run following command from anywhere you have your input file to generate platforms icons
> electron-icon-maker --input=icon.png --output=./out
# Rename and move files to match with next config
- ./workspaces/electron-app/main/assets/icons/icon.png for Linux
- ./workspaces/electron-app/main/assets/icons/icon.icns for MacOs
- ./workspaces/electron-app/main/assets/icons/icon.ico for Windows
x

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 231 KiB

View File

@@ -21,8 +21,7 @@ export class Window {
width: 1280, width: 1280,
height: 720, height: 720,
backgroundColor: '#FFFFFF', backgroundColor: '#FFFFFF',
// FIXME icon: this.loadIcon(),
// icon: this.loadIcon(),
webPreferences: { webPreferences: {
// Default behavior in Electron since 5, that // Default behavior in Electron since 5, that
// limits the powers granted to remote content // limits the powers granted to remote content