Windows tray theme (#1593)
* images * use expected theme on windows * fix shadowing Co-authored-by: = <=>
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 9.4 KiB |
BIN
src/assets/windows/tray_dark.ico
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/windows/tray_dark_mention.ico
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/windows/tray_dark_unread.ico
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/windows/tray_light.ico
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/windows/tray_light_mention.ico
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/windows/tray_light_unread.ico
Normal file
After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 9.4 KiB |
@@ -2,7 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import {app, nativeImage, Tray, systemPreferences} from 'electron';
|
import {app, nativeImage, Tray, systemPreferences, nativeTheme} from 'electron';
|
||||||
|
|
||||||
import {UPDATE_TRAY} from 'common/communication';
|
import {UPDATE_TRAY} from 'common/communication';
|
||||||
|
|
||||||
@@ -17,12 +17,14 @@ let lastStatus = 'normal';
|
|||||||
let lastMessage = app.name;
|
let lastMessage = app.name;
|
||||||
|
|
||||||
export function refreshTrayImages(trayIconTheme) {
|
export function refreshTrayImages(trayIconTheme) {
|
||||||
|
const winTheme = nativeTheme.shouldUseDarkColors ? 'dark' : 'light';
|
||||||
|
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
trayImages = {
|
trayImages = {
|
||||||
normal: nativeImage.createFromPath(path.resolve(assetsDir, 'windows/tray.ico')),
|
normal: nativeImage.createFromPath(path.resolve(assetsDir, `windows/tray_${winTheme}.ico`)),
|
||||||
unread: nativeImage.createFromPath(path.resolve(assetsDir, 'windows/tray_unread.ico')),
|
unread: nativeImage.createFromPath(path.resolve(assetsDir, `windows/tray_${winTheme}_unread.ico`)),
|
||||||
mention: nativeImage.createFromPath(path.resolve(assetsDir, 'windows/tray_mention.ico')),
|
mention: nativeImage.createFromPath(path.resolve(assetsDir, `windows/tray_${winTheme}_mention.ico`)),
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
|