diff --git a/main-electron.js b/main-electron.js index 1249be75..02a9914d 100644 --- a/main-electron.js +++ b/main-electron.js @@ -1,15 +1,28 @@ +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 // 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. + // Set icon + let icon = join(globalAny.__static, '/png/512x512.png'); + if (process.platform === "win32") { + icon = join(globalAny.__static, '/win/icon.ico'); + } + + // Create the browser window win = new BrowserWindow({ width: 377, height: 800, title: "Sengi", + icon: icon, backgroundColor: "#131925", useContentSize: true, webPreferences: { 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",