diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b444f0..e9e807a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ An electron-base client for Google Hangouts Chat, since Google didn't see fit to provide one. ## CHANGELOG + +### 5.27.23-2 + +Add a menu in 'View' to change tray icon theme. + ### 5.27.23-1 Add support for several iconThemes, to match some 'monochrome' desktop themes. 3 values are supported : diff --git a/README.md b/README.md index 570831c..6ccd119 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,10 @@ So, **to use electron's Wayland rendering** edit `/usr/share/applciations/google See full [CHANGELOG](./CHANGELOG.md). +### 5.27.23-2 + +Add a menu in 'View' to change tray icon theme. + ### 5.27.23-1 Add support for several iconThemes, to match some 'monochrome' desktop themes. 3 values are supported : diff --git a/package-lock.json b/package-lock.json index de51db5..d3f70f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "google-chat-linux", - "version": "5.27.23-1", + "version": "5.27.23-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "google-chat-linux", - "version": "5.27.23-1", + "version": "5.27.23-2", "license": "WTFPL", "dependencies": { "electron-context-menu": "^3.5.0" diff --git a/package.json b/package.json index e2d9c5b..28410d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "google-chat-linux", - "version": "5.27.23-1", + "version": "5.27.23-2", "description": "Unofficial alternative Google Chat desktop app", "main": "src/index.js", "scripts": { diff --git a/src/window.js b/src/window.js index 80beed8..b215e61 100644 --- a/src/window.js +++ b/src/window.js @@ -4,6 +4,10 @@ const pathsManifest = require("./paths"); const { platform } = require("process"); const ConfigManager = require("./configs"); +const DEFAULT_ICONS = 'default' +const COLORED_ICONS = 'colored' +const MONO_ICONS = 'mono' + let mainWindow; let isQuitting = false; let keepMinimized = true; @@ -131,6 +135,12 @@ const onQuitEntryClicked = () => { app.quit(); } +const onSetIconThemeClicked = (theme) => { + iconTheme = theme; + app.relaunch(); + onQuitEntryClicked(); +} + const onToggleThirdPartyAuthLoginMode = () => { setThirdPartyAuthLoginMode(!getThirdPartyAuthLoginMode()); if (getThirdPartyAuthLoginMode()) { @@ -292,7 +302,7 @@ const initializeWindow = (config) => { openUrlInside = (config && config.openUrlInside); useXdgOpen = (config && config.useXdgOpen); thirdPartyAuthLoginMode = (config && config.thirdPartyAuthLoginMode); - + iconTheme = (config && config.iconTheme) mainWindow = new BrowserWindow(bwOptions); let url = getURL(process.argv) @@ -336,7 +346,7 @@ const initializeWindow = (config) => { configsData.openUrlInside = openUrlInside; configsData.useXdgOpen = useXdgOpen; configsData.thirdPartyAuthLoginMode = thirdPartyAuthLoginMode; - + configsData.iconTheme = iconTheme; ConfigManager.updateConfigs(configsData); } else { e.preventDefault(); @@ -383,6 +393,10 @@ const getUseXdgOpenTick = () => { return getUseXdgOpen() ? '☑' : '☐'; } +const getIconThemeTick = (theme) => { + return iconTheme === theme ? '☑' : '☐'; +} + const menuSubMenu = () => { return [ @@ -442,6 +456,25 @@ const viewSubMenu = () => { click: () => { onStartHiddenClicked(); } + }, { + type: 'separator' + }, { + label: 'Tray icon theme (restart)', + }, { + label: getIconThemeTick(DEFAULT_ICONS) + ' ' + DEFAULT_ICONS, + click: () => { + onSetIconThemeClicked(DEFAULT_ICONS); + } + }, { + label: getIconThemeTick(COLORED_ICONS) + ' ' + COLORED_ICONS, + click: () => { + onSetIconThemeClicked(COLORED_ICONS); + } + }, { + label: getIconThemeTick(MONO_ICONS) + ' ' + MONO_ICONS, + click: () => { + onSetIconThemeClicked(MONO_ICONS); + } } ] }