From 7c6239b9c190f40e53920878cfb30db0885f3c92 Mon Sep 17 00:00:00 2001 From: Roldan Montilla Jr Date: Fri, 19 Jun 2020 13:10:36 +0800 Subject: [PATCH] update: used transparent version of the logo for switching custom titlebar to a native one --- app/electron/electron.ts | 2 +- app/electron/helpers/getIcon.ts | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/electron/electron.ts b/app/electron/electron.ts index 4b7a14a3..379b5ee0 100644 --- a/app/electron/electron.ts +++ b/app/electron/electron.ts @@ -62,7 +62,7 @@ function createMainWindow() { maximizable: false, show: false, frame: hasFrame, - icon: getIcon(isDarkMode), + icon: getIcon(), backgroundColor: isDarkMode ? "#141e25" : "#fff", webPreferences: { contextIsolation: true, diff --git a/app/electron/helpers/getIcon.ts b/app/electron/helpers/getIcon.ts index 9005e91c..60e2c3e4 100644 --- a/app/electron/helpers/getIcon.ts +++ b/app/electron/helpers/getIcon.ts @@ -1,18 +1,21 @@ import path from "path"; -export function getIcon(isDarkMode: boolean) { +export function getIcon() { switch (process.platform) { case "darwin": - return isDarkMode - ? path.join(__dirname, "../../src/assets/logos/logo-dark@2x.png") - : path.join(__dirname, "../../src/assets/logos/logo-light@2x.png"); + return path.join( + __dirname, + "../../src/assets/logos/logo-transparent@2x.png" + ); case "linux": - return isDarkMode - ? path.join(__dirname, "../../src/assets/logos/logo-dark.png") - : path.join(__dirname, "../../src/assets/logos/logo-light.png"); + return path.join( + __dirname, + "../../src/assets/logos/logo-transparent.png" + ); default: - return isDarkMode - ? path.join(__dirname, "../../src/assets/logos/logo-dark.ico") - : path.join(__dirname, "../../src/assets/logos/logo-light.ico"); + return path.join( + __dirname, + "../../src/assets/logos/logo-transparent.ico" + ); } }