From 0d1a2e59d4e357af2d182d2bfad4d9741781fbae Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 1 Oct 2020 21:42:30 -0400 Subject: [PATCH 1/7] added icon on main windows --- main-electron.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main-electron.js b/main-electron.js index 1249be75..b01d9f0a 100644 --- a/main-electron.js +++ b/main-electron.js @@ -1,3 +1,4 @@ +const { join } = require("path"); const { app, Menu, MenuItem, BrowserWindow, shell } = require("electron"); // Keep a global reference of the window object, if you don't, the window will @@ -10,6 +11,8 @@ function createWindow() { width: 377, height: 800, title: "Sengi", + //icon: join(__dirname, '/src/assets/icons/icon-512x512.png'), + icon: join(__dirname, '/assets/icons/win/icon.ico'), backgroundColor: "#131925", useContentSize: true, webPreferences: { From 45d735835b2a78277f54342df2e29c819c7e58a7 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 1 Oct 2020 21:58:35 -0400 Subject: [PATCH 2/7] added multi os icon specs --- main-electron.js | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/main-electron.js b/main-electron.js index b01d9f0a..9a1c9bb2 100644 --- a/main-electron.js +++ b/main-electron.js @@ -7,23 +7,37 @@ let win; function createWindow() { // Create the browser window. - win = new BrowserWindow({ - width: 377, - height: 800, - title: "Sengi", - //icon: join(__dirname, '/src/assets/icons/icon-512x512.png'), - icon: join(__dirname, '/assets/icons/win/icon.ico'), - backgroundColor: "#131925", - useContentSize: true, - webPreferences: { - spellcheck: false - } - // webPreferences: { - // contextIsolation: true, - // nodeIntegration: false, - // nodeIntegrationInWorker: false - // } - }); + if(process.platform === "win32"){ + win = new BrowserWindow({ + width: 377, + height: 800, + title: "Sengi", + icon: join(__dirname, '/assets/icons/win/icon.ico'), + backgroundColor: "#131925", + useContentSize: true, + webPreferences: { + spellcheck: false + } + // webPreferences: { + // contextIsolation: true, + // nodeIntegration: false, + // nodeIntegrationInWorker: false + // } + }); + } else { + win = new BrowserWindow({ + width: 377, + height: 800, + title: "Sengi", + //icon: join(__dirname, '/src/assets/icons/icon-512x512.png'), + icon: join(__dirname, '/assets/icons/png/512x512.png'), + backgroundColor: "#131925", + useContentSize: true, + webPreferences: { + spellcheck: false + } + }); + } win.setAutoHideMenuBar(true); win.setMenuBarVisibility(false); From c2f9c17189d8ce48428904f978a07add484f5f4d Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 1 Oct 2020 22:01:09 -0400 Subject: [PATCH 3/7] refactoring --- main-electron.js | 52 +++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/main-electron.js b/main-electron.js index 9a1c9bb2..6fc423ed 100644 --- a/main-electron.js +++ b/main-electron.js @@ -7,37 +7,27 @@ let win; function createWindow() { // Create the browser window. - if(process.platform === "win32"){ - win = new BrowserWindow({ - width: 377, - height: 800, - title: "Sengi", - icon: join(__dirname, '/assets/icons/win/icon.ico'), - backgroundColor: "#131925", - useContentSize: true, - webPreferences: { - spellcheck: false - } - // webPreferences: { - // contextIsolation: true, - // nodeIntegration: false, - // nodeIntegrationInWorker: false - // } - }); - } else { - win = new BrowserWindow({ - width: 377, - height: 800, - title: "Sengi", - //icon: join(__dirname, '/src/assets/icons/icon-512x512.png'), - icon: join(__dirname, '/assets/icons/png/512x512.png'), - backgroundColor: "#131925", - useContentSize: true, - webPreferences: { - spellcheck: false - } - }); - } + let icon = join(__dirname, '/assets/icons/png/512x512.png'); + if (process.platform === "win32") { + icon = join(__dirname, '/assets/icons/win/icon.ico'); + } + + win = new BrowserWindow({ + width: 377, + height: 800, + title: "Sengi", + icon: icon, + backgroundColor: "#131925", + useContentSize: true, + webPreferences: { + spellcheck: false + } + // webPreferences: { + // contextIsolation: true, + // nodeIntegration: false, + // nodeIntegrationInWorker: false + // } + }); win.setAutoHideMenuBar(true); win.setMenuBarVisibility(false); From 180f218eb08cf2574d63fdb8072911ad6b4a9191 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 1 Oct 2020 22:11:06 -0400 Subject: [PATCH 4/7] trigger CI/CD --- main-electron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main-electron.js b/main-electron.js index 6fc423ed..81824532 100644 --- a/main-electron.js +++ b/main-electron.js @@ -6,7 +6,7 @@ const { app, Menu, MenuItem, BrowserWindow, shell } = require("electron"); let win; function createWindow() { - // Create the browser window. + // Create the browser window let icon = join(__dirname, '/assets/icons/png/512x512.png'); if (process.platform === "win32") { icon = join(__dirname, '/assets/icons/win/icon.ico'); From 24c188aa80286ca44dc5ccc279ba383137b3443d Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 1 Oct 2020 22:33:29 -0400 Subject: [PATCH 5/7] road to 0.32.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a612428..15b354fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sengi", - "version": "0.32.0", + "version": "0.32.1", "license": "AGPL-3.0-or-later", "main": "main-electron.js", "description": "A multi-account desktop client for Mastodon and Pleroma", From 49c776a67c11a19ea1e2e24bff68d970c46411c6 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 1 Oct 2020 23:04:18 -0400 Subject: [PATCH 6/7] try fix for KDE --- main-electron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main-electron.js b/main-electron.js index 81824532..665b70f9 100644 --- a/main-electron.js +++ b/main-electron.js @@ -7,7 +7,7 @@ let win; function createWindow() { // Create the browser window - let icon = join(__dirname, '/assets/icons/png/512x512.png'); + let icon = join(__dirname, '/src/assets/icons/icon-512x512.png'); if (process.platform === "win32") { icon = join(__dirname, '/assets/icons/win/icon.ico'); } From 0c361d57fc43b40a91f89d32f374d95127af08f2 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Fri, 2 Oct 2020 20:59:36 -0400 Subject: [PATCH 7/7] try other icon fix --- main-electron.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main-electron.js b/main-electron.js index 665b70f9..02a9914d 100644 --- a/main-electron.js +++ b/main-electron.js @@ -4,14 +4,20 @@ const { app, Menu, MenuItem, BrowserWindow, shell } = require("electron"); // 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 win; +const globalAny = global; + +if (process.env.NODE_ENV !== 'development') { + globalAny.__static = require('path').join(__dirname, '/assets/icons').replace(/\\/g, '\\\\'); +} function createWindow() { - // Create the browser window - let icon = join(__dirname, '/src/assets/icons/icon-512x512.png'); + // Set icon + let icon = join(globalAny.__static, '/png/512x512.png'); if (process.platform === "win32") { - icon = join(__dirname, '/assets/icons/win/icon.ico'); + icon = join(globalAny.__static, '/win/icon.ico'); } + // Create the browser window win = new BrowserWindow({ width: 377, height: 800,