diff options
| author | David Lönnhager <david.l@mullvad.net> | 2019-10-18 14:02:21 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2019-10-23 13:41:19 +0200 |
| commit | eca83074097e5b715ac880723b69c42ffab14320 (patch) | |
| tree | 7c79a4464f653502024865de0d1f4d50b5774611 /gui/src | |
| parent | ef07d2adf5738a052837781082ea6f845bd7706c (diff) | |
| download | mullvadvpn-eca83074097e5b715ac880723b69c42ffab14320.tar.xz mullvadvpn-eca83074097e5b715ac880723b69c42ffab14320.zip | |
Use larger PNG icon in notifications on Windows
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/notification-controller.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 4b0f59fbf6..976d0dda4c 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -1,4 +1,5 @@ import { app, nativeImage, NativeImage, Notification, shell } from 'electron'; +import os from 'os'; import path from 'path'; import { sprintf } from 'sprintf-js'; import config from '../config.json'; @@ -14,7 +15,16 @@ export default class NotificationController { private notificationIcon?: NativeImage; constructor() { + let usePngIcon; if (process.platform === 'linux') { + usePngIcon = true; + } else if (process.platform === 'win32') { + usePngIcon = parseInt(os.release().split('.')[0], 10) >= 10; + } else { + usePngIcon = false; + } + + if (usePngIcon) { const basePath = path.resolve(path.join(__dirname, '../../assets/images')); this.notificationIcon = nativeImage.createFromPath( path.join(basePath, 'icon-notification.png'), |
