From 410f653eaef0bb1ab8131405cf294bfee0a677ec Mon Sep 17 00:00:00 2001 From: Sakii <13037299+SakiiCode@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:06:26 +0200 Subject: [PATCH] Add monochrome tray icon toggle --- res/img/monochrome.ico | Bin 0 -> 74814 bytes res/img/monochrome.png | Bin 0 -> 8020 bytes src/@types/global.d.ts | 5 +++-- src/electron-main.ts | 8 +++++--- src/i18n/strings/en_EN.json | 1 + src/tray.ts | 28 ++++++++++++++++++++++++++-- 6 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 res/img/monochrome.ico create mode 100644 res/img/monochrome.png diff --git a/res/img/monochrome.ico b/res/img/monochrome.ico new file mode 100644 index 0000000000000000000000000000000000000000..6324ab8d6592300a572c1bed96b995943bdd2260 GIT binary patch literal 74814 zcmeHOJ+dRW5$4k?*K?JFjqDAXI8de|P)Cph$2!U|^f45wHn5K%9zjQ7=x_rETPkVk zZU94c1Ks!`0dQvcMpciE{`%+p8kiaC?e1>(0{`LlvitMy+rPi;{s#89*0I}tWBs_4 zuFK^jx!-;76L_D%6HMTx?lR9BeBRjq@Y#a@;pdoZ?lm)DpLJR)qlZbne~>Vg#@GFv z23Ke~g2B{VwQDtkR(u{%=l;9k0i@fuyk`U}dgSRtyL|w9&6OdyjbLRWb-K66*Q>1( zsU5*8MW#sC4Iou%tyskb)+#a0yLbTUGV4VP2e4j&S?2i(WJ|0&;C%p@39Ng23)rXi z7Zg}~NNNCU*H*+|A3#z1>Vs7Mt5;SiKp8+`_WHwQ{p;6NtUw$w-Ef~^5G9`*|mi&t<*sESEgrcxLpnso*c5wT@P<8`oJ^B9I??40Qyx10a03J;)_-jf-|IW$7 z_1ilz_&IP#9=QF1Xu2FW0BAa_7i$z8dMX}m7Ta?%u$7k)suk8gxUV&C(q4xkH+K2( zuGVn^>}&Cn`cBhylc~Mfdw((pKObB)@x` z0;y6+cV2@UNZLw#gXr~cQzBJ}=}l`?eL-4@YZSfSeM+>lnEp@W-jZp3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9X$K`n2#F##c`bGL=%L3+yj5@86C{uQ$hGLAnmaK8yy(F zObCv<@k%!Y^T~E%KEEKJ;CweR5;lO~6WeXXVFO4>F`wWtZA>B;&lho`C&pnrdHo|P zjwYidfzd9}M5K(`JGgC8&S)sm40ckwZSiKYot~%xA!EGaObd zpPwe!yw6eo7herF|96h_(*lPNk1Ov_b^{LI*C?Ok7oHENjqElaUY?J)JK=}D=l)0Z z2agNDj(b`W^G_IPFPd*XfS(-*9|x$98vHde9P{584*6t&kbjKw$pCCVabQQ%4ptzE z6hyUT0EoX#CqwUOej;uyTmpXF{oAkYFIr9rnG5sz1rsOFlNf&k+<$SOqI}!{FJL0J z?SmWOcOcHk=e6GfTFdc-6o13h`bQgp`1Q-XkiSQKRzOO*@@ByE_f{b5wYUHr09x{$z3Hqh%aU zT`bn7>+&tmPKS_B<zu&U?jGmBxrkn+w!n+vfzx?1h z&i~g${sHhK!(UHyx%clN=YC;0oS&a)JlxF;fBEMR9NxX214ppr`2h&aw=?`mTyJdJ zabOP5{r>y|+wHjiK8MqLIZodlayUDUae;|GYhoDQMS_#K*t3fGoe3xU7<;`39_A;% ziY>s;vDbUxVV}d38w>|BiNk?T4j68TBtBiz0|GcTVDmsYdAXs5@50mo@m-h_XrAYZ z0qik9ae@wrCj?9eKZdmDwV|I7VCW}aSMGJB?!ex(*N>oswF%nCF$5|1sB3?@{4opS YpVM4lKBM*vor(G5A3PIRf3@lV2kaw2UH||9 literal 0 HcmV?d00001 diff --git a/res/img/monochrome.png b/res/img/monochrome.png new file mode 100644 index 0000000000000000000000000000000000000000..5f9d0d7dd74cb4026746bac6be62ffd044ad27fd GIT binary patch literal 8020 zcmX9@XIN8B(>_V)2na|KM3gGMgx*C_Lhro<&>#X54ZQ|IlqM2tC?XPiH&kgyl%@fs zgS4Om(oqqR=9lOFew=I1HQQ!qW@l&ai8nL3&BVaN0000JLjR@(06-|e5P*(`(l|XT zLs1%fw7xwC0GQwZ_d)vn%I;8z7yb3@{4M=Z{y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y*(yEgs3gW6vBz~dC^_g_}K}1*2_o+^0A4JE@b{t;qd*h0GP7|5w zX|y_bsRVMIJ;VQtE_0(teC-qX4;n)oT8*jks%5)%yfY|)+%A~JHBr?7oWuXCthph% z;9=5~%9`!59I=Z%koo!0fAn>Cq31e$vZ?8U4M-1*m;nq!ihwd#)H$=g}N!0$$VAs_04Pi4su`M1hgum|oMCQ~bQi^gy$1Dwnp9Q-feR5b7m)mq_2be%2(; var trayConfig: { - // eslint-disable-next-line camelcase - icon_path: string; + color_icon_path: string; // eslint-disable-line camelcase + monochrome_icon_path: string; // eslint-disable-line camelcase brand: string; }; var store: Store<{ @@ -31,6 +31,7 @@ declare global { autoHideMenuBar?: boolean; locale?: string | string[]; disableHardwareAcceleration?: boolean; + monochrome?: boolean; }>; } /* eslint-enable no-var */ diff --git a/src/electron-main.ts b/src/electron-main.ts index febd87b..9ff8f8f 100644 --- a/src/electron-main.ts +++ b/src/electron-main.ts @@ -212,9 +212,11 @@ async function setupGlobals(): Promise { // The tray icon // It's important to call `path.join` so we don't end up with the packaged asar in the final path. - const iconFile = `element.${process.platform === "win32" ? "ico" : "png"}`; + const colorIconFile = `element.${process.platform === "win32" ? "ico" : "png"}`; + const monochromeIconFile = `monochrome.${process.platform === "win32" ? "ico" : "png"}`; global.trayConfig = { - icon_path: path.join(resPath, "img", iconFile), + monochrome_icon_path: path.join(resPath, "img", monochromeIconFile), + color_icon_path: path.join(resPath, "img", colorIconFile), brand: global.vectorConfig.brand || "Element", }; @@ -453,7 +455,7 @@ app.on("ready", async () => { titleBarStyle: process.platform === "darwin" ? "hidden" : "default", trafficLightPosition: { x: 9, y: 8 }, - icon: global.trayConfig.icon_path, + icon: global.trayConfig.color_icon_path, show: false, autoHideMenuBar: global.store.get("autoHideMenuBar", true), diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 2bdb0bc..cc776da 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -14,6 +14,7 @@ "redo": "Redo", "select_all": "Select All", "show_hide": "Show/Hide", + "toggle_monochrome": "Monochrome Icon", "undo": "Undo", "zoom_in": "Zoom In", "zoom_out": "Zoom Out" diff --git a/src/tray.ts b/src/tray.ts index 339ca83..f633380 100644 --- a/src/tray.ts +++ b/src/tray.ts @@ -38,8 +38,20 @@ function toggleWin(): void { } } +function toggleMonochrome(): void { + const monochrome = !isMonochrome(); + if (monochrome) { + trayIcon?.setImage(nativeImage.createFromPath(global.trayConfig.monochrome_icon_path)); + } else { + trayIcon?.setImage(nativeImage.createFromPath(global.trayConfig.color_icon_path)); + } + global.store.set("monochrome", monochrome); + initApplicationMenu(); +} + interface IConfig { - icon_path: string; // eslint-disable-line camelcase + color_icon_path: string; // eslint-disable-line camelcase + monochrome_icon_path: string; // eslint-disable-line camelcase brand: string; } @@ -49,10 +61,16 @@ function getUuid(): string { return global.vectorConfig["uuid"] || "eba84003-e499-4563-8e9d-166e34b5cc25"; } +function isMonochrome(): boolean { + return global.store.get("monochrome", process.platform === "linux"); +} + export function create(config: IConfig): void { // no trays on darwin if (process.platform === "darwin" || trayIcon) return; - const defaultIcon = nativeImage.createFromPath(config.icon_path); + const defaultIcon = nativeImage.createFromPath( + isMonochrome() ? config.monochrome_icon_path : config.color_icon_path, + ); let guid: string | undefined; if (process.platform === "win32" && app.isPackaged) { @@ -114,6 +132,12 @@ export function initApplicationMenu(): void { } const contextMenu = Menu.buildFromTemplate([ + { + label: _t("action|toggle_monochrome"), + click: toggleMonochrome, + type: "checkbox", + checked: isMonochrome(), + }, { label: _t("action|show_hide"), click: toggleWin,