mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
a6c44b8529
Summary: - Updates support for ES6 code inside packages - Displays system tray icon with unread count on darwin, or with bubble on other platforms - Uses canvas api to dynamically generate icon image given unread count: - Adds CavasUtils.canvasFromImgAndText to do this - Adds config option to display system tray icon on darwin Test Plan: Need to write the tests for this. Reviewers: evan, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2231
32 lines
669 B
JavaScript
32 lines
669 B
JavaScript
import SystemTray from './system-tray';
|
|
const platform = process.platform;
|
|
|
|
let systemTray;
|
|
let unsubConfig;
|
|
const onSystemTrayToggle = (showSystemTray)=> {
|
|
if (showSystemTray.newValue) {
|
|
systemTray = new SystemTray(platform);
|
|
} else {
|
|
systemTray.destroy();
|
|
systemTray = null;
|
|
}
|
|
};
|
|
|
|
export function activate() {
|
|
unsubConfig = atom.config.onDidChange('core.showSystemTray', onSystemTrayToggle);
|
|
if (atom.config.get('core.showSystemTray')) {
|
|
systemTray = new SystemTray(platform);
|
|
}
|
|
}
|
|
|
|
export function deactivate() {
|
|
if (systemTray) {
|
|
systemTray.destroy();
|
|
systemTray = null;
|
|
}
|
|
unsubConfig();
|
|
}
|
|
|
|
export function serialize() {
|
|
|
|
}
|