🐛 Fix: add new tray icon for macOS dark-mode

ISSUES CLOSED: #267
This commit is contained in:
Molunerfinn 2019-05-23 00:13:12 +08:00
parent 5a064830c6
commit c5adf3b68c
7 changed files with 17 additions and 2 deletions

View File

@ -1,7 +1,18 @@
'use strict' 'use strict'
import Uploader from './utils/uploader.js' import Uploader from './utils/uploader.js'
import { app, BrowserWindow, Tray, Menu, Notification, clipboard, ipcMain, globalShortcut, dialog } from 'electron' import {
app,
BrowserWindow,
Tray,
Menu,
Notification,
clipboard,
ipcMain,
globalShortcut,
dialog,
systemPreferences
} from 'electron'
import db from '../datastore' import db from '../datastore'
import beforeOpen from './utils/beforeOpen' import beforeOpen from './utils/beforeOpen'
import pasteTemplate from './utils/pasteTemplate' import pasteTemplate from './utils/pasteTemplate'
@ -158,7 +169,11 @@ function createTray () {
}) })
tray.on('drag-enter', () => { tray.on('drag-enter', () => {
if (systemPreferences.isDarkMode()) {
tray.setImage(`${__static}/upload-dark.png`)
} else {
tray.setImage(`${__static}/upload.png`) tray.setImage(`${__static}/upload.png`)
}
}) })
tray.on('drag-end', () => { tray.on('drag-end', () => {

BIN
static/upload-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

BIN
static/upload-dark@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/upload-dark@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 777 B

BIN
static/upload@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/upload@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB