Browse Source

Fix the problem of Linux icon.

Emery 3 years ago
parent
commit
ea9692d11d
3 changed files with 9 additions and 1 deletions
  1. 1 1
      scripts/make.js
  2. BIN
      src/assets/icon.png
  3. 8 0
      src/main/main.ts

+ 1 - 1
scripts/make.js

@@ -161,7 +161,7 @@ const doMake = async () => {
           '${productName}_portable_${arch}_${version}(${buildVersion}).${ext}',
           '${productName}_portable_${arch}_${version}(${buildVersion}).${ext}',
       },
       },
       linux: {
       linux: {
-        icon: 'assets/app.png',
+        icon: 'assets/app.icns',
         artifactName:
         artifactName:
           '${productName}_linux_${arch}_${version}(${buildVersion}).${ext}',
           '${productName}_linux_${arch}_${version}(${buildVersion}).${ext}',
         category: 'Utility',
         category: 'Utility',

BIN
src/assets/icon.png


+ 8 - 0
src/main/main.ts

@@ -30,6 +30,13 @@ const createWindow = async () => {
     defaultHeight: 480,
     defaultHeight: 480,
   })
   })
 
 
+  let linux_icon = {}
+  if (process.platform === 'linux') {
+    linux_icon = {
+      icon: path.join(__dirname, '/assets/icon.png'),
+    }
+  }
+
   win = new BrowserWindow({
   win = new BrowserWindow({
     x: main_window_state.x,
     x: main_window_state.x,
     y: main_window_state.y,
     y: main_window_state.y,
@@ -45,6 +52,7 @@ const createWindow = async () => {
       preload: path.join(__dirname, 'preload.js'),
       preload: path.join(__dirname, 'preload.js'),
       spellcheck: true,
       spellcheck: true,
     },
     },
+    ...linux_icon,
   })
   })
 
 
   main_window_state.manage(win)
   main_window_state.manage(win)