From 3be6d482798070ff7217321160cd9caffb1d7781 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 16 Oct 2024 17:21:49 +0200 Subject: [PATCH] Revert "Add monochrome tray icon" --- res/img/monochrome.ico | Bin 4286 -> 0 bytes res/img/monochrome.png | Bin 6429 -> 0 bytes src/@types/global.d.ts | 5 ++--- src/electron-main.ts | 8 +++----- src/settings.ts | 9 --------- src/tray.ts | 20 ++------------------ 6 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 res/img/monochrome.ico delete mode 100644 res/img/monochrome.png diff --git a/res/img/monochrome.ico b/res/img/monochrome.ico deleted file mode 100644 index 4dd249e60167ac1aa0891006c9fd349535a6cd1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmcJTOK2295QclRNj74li!Txqa1kP23{gCIQ}7}l1Os`362XIy+&p-b%|#`65Dzhl zieAJZhzNonSH_4~)3Fguyu=_N@mf4aNsud1Hzp6XF!68th5 zqrYY}ZOjT|%o>2oYzETLR`U6LE$9S8;68W{ep;w6-6_xkYG<3z_a|087zE#etB5-c zR{3$tZShTkeo#(c=mnznIRaAUI~!RKJy1YG54$hR5C zUk=W{;k5g{^b=q`=muATtLVL$emCi#adhkpr5|^emEs+!0y_V1fOigP z+d!0P{WafWa#Hyv5PCpdow)s_&9Ktj6Zj^IHiI7{W~!(PJhtf##n&USe&D^pQqKc?gJM< zId{Km(~R#gJBMa$AHaNxzN-t?Jz^c!!I_UaD0fRZU(^_$*1>fzpvH>UeEPc}DrZ;+ zU*|z*s+{)%dV%O&7yvcl_^xAo^=_&@xYQ_Uo`|cO-|U(vjz=ujN!4oI7rL`_M)Z7w z`qGVnF5rEu#l@68pW~{enKEY6q%kWej9L8Bm{iV~WG<0QW~)siTg!hT)MSiFZv@rG pv?fvLXR?C#%kfYCUY5BDRHjk2CbFhi5t53fn2N0&%B7sj{SVvOIr;zq diff --git a/res/img/monochrome.png b/res/img/monochrome.png deleted file mode 100644 index a3f501835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Q-)N69tX0;Zc35>Z6s&k_%)YY1W2Uc=yPN|qcqzA>9<$-s_iNX z6eHXv5Zv5k=*{U?N&`NlZ)n$F;Uahoi7~U|%9wsueB_?a2v34+3g7%tnbxk?g9IiR zD!tN&67bJ~s*=9uHxp|3GicaQ7o=E!A(`*;-X{%6=3J6@7p9la+eJcN3X{n=Sl-v7A^t7b;*|F5?f65D zrtm`4PRhWIWs@{V%M@8a_wmb(e${pPb)xg*Si9!4!B^F_t$fP#n z@xkhWI~cnv#xMazkV>TnGqs|Pxxm3Wvv(JEzzM|sfgi18`2s-xta1Mp4W#J5(2Km_ zSF76h`fNCMUcMid<}dZ60rtTkiPtg%J@B7FNApwFA4kjkG#7*M( zKNL|vg`EF~LZ+t>^?!)HehRt%gIs14WI1;^0Q@B_2eKo%JJO~gtqaiKR@((hpAice z{?;n@;!uX{ssP3|d{r9Y%O>v|?OK(@8!+KgM_{TZG*`FkDA_UfgBK(dbf& z(CA{`6Q1@{rVru%^Hu1Tg=5e;mE5&hwaJ*{8fjVjDTC3nJQP?AdeNk3Uao++rcGXi z;G7-tB4jrL?O5xSG~65;U~Yj52IhGA=A2s6wt;uvRN^(Zb0XOMl)=(rtr)4a(*y-U z3Wg(>qbxqu&OJ#%ICHE_J*0)eW*4q}NFO^S|kc5||N6@Iq+RXU6h3G+ATOocNs8o$^}D5mOTMj-byTDeJ`V#m2s6Ie;$n z;_5H6K?o=W+qG3Z@CP6rh+UYZybU7$LPmSnR8Z5KcrYUMataoegz87H%eTeJ#wbYu zOl4k_2NSK|%}N2>8*X@!8#dvT7;uTPXf->=!WWD`TnywS6 z#Bf~i=n=*nd29}FWks;CWg?nKHj?-4%9bz0_CDOda-doNO_KbTH!|``j$FwJU7NHl W; var trayConfig: { - color_icon_path: string; // eslint-disable-line camelcase - monochrome_icon_path: string; // eslint-disable-line camelcase + // eslint-disable-next-line camelcase + icon_path: string; brand: string; }; var store: Store<{ @@ -31,7 +31,6 @@ declare global { autoHideMenuBar?: boolean; locale?: string | string[]; disableHardwareAcceleration?: boolean; - monochromeIcon?: boolean; }>; } /* eslint-enable no-var */ diff --git a/src/electron-main.ts b/src/electron-main.ts index a3623a6be6..5a948cbf69 100644 --- a/src/electron-main.ts +++ b/src/electron-main.ts @@ -212,11 +212,9 @@ 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 colorIconFile = `element.${process.platform === "win32" ? "ico" : "png"}`; - const monochromeIconFile = `monochrome.${process.platform === "win32" ? "ico" : "png"}`; + const iconFile = `element.${process.platform === "win32" ? "ico" : "png"}`; global.trayConfig = { - monochrome_icon_path: path.join(resPath, "img", monochromeIconFile), - color_icon_path: path.join(resPath, "img", colorIconFile), + icon_path: path.join(resPath, "img", iconFile), brand: global.vectorConfig.brand || "Element", }; @@ -455,7 +453,7 @@ app.on("ready", async () => { titleBarStyle: process.platform === "darwin" ? "hidden" : "default", trafficLightPosition: { x: 9, y: 8 }, - icon: global.trayConfig.color_icon_path, + icon: global.trayConfig.icon_path, show: false, autoHideMenuBar: global.store.get("autoHideMenuBar", true), diff --git a/src/settings.ts b/src/settings.ts index b4a13ad2b7..50e3a087d6 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -67,13 +67,4 @@ export const Settings: Record = { global.store.set("disableHardwareAcceleration", !value); }, }, - "Electron.monochromeIcon": { - async read(): Promise { - return tray.isMonochrome(); - }, - async write(value: any): Promise { - global.store.set("monochromeIcon", value); - tray.refreshIcon(); - }, - }, }; diff --git a/src/tray.ts b/src/tray.ts index b863238567..339ca833d8 100644 --- a/src/tray.ts +++ b/src/tray.ts @@ -28,19 +28,6 @@ export function destroy(): void { } } -export function isMonochrome(): boolean { - return global.store.get("monochromeIcon", process.platform === "linux"); -} - -export function refreshIcon(): 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)); - } -} - function toggleWin(): void { if (global.mainWindow?.isVisible() && !global.mainWindow.isMinimized() && global.mainWindow.isFocused()) { global.mainWindow.hide(); @@ -52,8 +39,7 @@ function toggleWin(): void { } interface IConfig { - color_icon_path: string; // eslint-disable-line camelcase - monochrome_icon_path: string; // eslint-disable-line camelcase + icon_path: string; // eslint-disable-line camelcase brand: string; } @@ -66,9 +52,7 @@ function getUuid(): string { export function create(config: IConfig): void { // no trays on darwin if (process.platform === "darwin" || trayIcon) return; - const defaultIcon = nativeImage.createFromPath( - isMonochrome() ? config.monochrome_icon_path : config.color_icon_path, - ); + const defaultIcon = nativeImage.createFromPath(config.icon_path); let guid: string | undefined; if (process.platform === "win32" && app.isPackaged) {