mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-30 11:59:02 +08:00
Move default icon to a path preserved in packaged app
This commit is contained in:
parent
731aa71134
commit
96c95eef18
5 changed files with 20 additions and 16 deletions
|
@ -106,7 +106,14 @@ module.exports = grunt => {
|
|||
writeFromTemplate(path.join(linuxAssetsDir, 'mailspring.desktop.in'), data);
|
||||
writeFromTemplate(path.join(linuxAssetsDir, 'mailspring.appdata.xml.in'), data);
|
||||
|
||||
const icon = path.join(grunt.config('appDir'), 'build', 'resources', 'mailspring.png');
|
||||
const icon = path.join(
|
||||
grunt.config('appDir'),
|
||||
'build',
|
||||
'resources',
|
||||
'linux',
|
||||
'icons',
|
||||
'512.png'
|
||||
);
|
||||
const cmd = path.join(grunt.config('appDir'), 'script', 'mkdeb');
|
||||
const args = [version, arch, icon, linuxAssetsDir, contentsDir, outputDir];
|
||||
spawn({ cmd, args }, spawnError => {
|
||||
|
|
|
@ -162,7 +162,7 @@ export default class AutoUpdateManager extends EventEmitter {
|
|||
}
|
||||
|
||||
iconURL() {
|
||||
const url = path.join(process.resourcesPath, 'app', 'mailspring.png');
|
||||
const url = path.join(process.resourcesPath, 'static', 'images', 'mailspring.png');
|
||||
if (!fs.existsSync(url)) {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
@ -114,16 +114,8 @@ export default class MailspringWindow extends EventEmitter {
|
|||
if (process.platform === 'linux') {
|
||||
if (!WindowIconPath) {
|
||||
WindowIconPath = path.resolve('/usr', 'share', 'pixmaps', 'mailspring.png');
|
||||
// Provides icon when running from npm start / development mode.
|
||||
if (!fs.existsSync(WindowIconPath)) {
|
||||
WindowIconPath = path.resolve(
|
||||
__dirname,
|
||||
'..',
|
||||
'..',
|
||||
'build',
|
||||
'resources',
|
||||
'mailspring.png'
|
||||
);
|
||||
WindowIconPath = path.resolve(this.resourcePath, 'static', 'images', 'mailspring.png');
|
||||
}
|
||||
}
|
||||
browserWindowOptions.icon = WindowIconPath;
|
||||
|
|
|
@ -5,7 +5,12 @@ import fs from 'fs';
|
|||
import os from 'os';
|
||||
|
||||
const platform = process.platform;
|
||||
const DEFAULT_ICON = path.resolve(__dirname, '..', 'build', 'resources', 'mailspring.png');
|
||||
const DEFAULT_ICON = path.resolve(
|
||||
AppEnv.getLoadSettings().resourcePath,
|
||||
'static',
|
||||
'images',
|
||||
'mailspring.png'
|
||||
);
|
||||
|
||||
let MacNotifierNotification = null;
|
||||
if (platform === 'darwin') {
|
||||
|
@ -13,13 +18,13 @@ if (platform === 'darwin') {
|
|||
MacNotifierNotification = require('node-mac-notifier');
|
||||
} catch (err) {
|
||||
console.error(
|
||||
'node-mac-notifier (a platform-specific optionalDependency) was not installed correctly! Check the Travis build log for errors.',
|
||||
'node-mac-notifier (a platform-specific optionalDependency) was not installed correctly! Check the Travis build log for errors.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
type INotificationCallback = (
|
||||
args: { response: string | null; activationType: 'replied' | 'clicked' },
|
||||
args: { response: string | null; activationType: 'replied' | 'clicked' }
|
||||
) => any;
|
||||
|
||||
type INotificationOptions = {
|
||||
|
@ -29,7 +34,7 @@ type INotificationOptions = {
|
|||
tag?: string;
|
||||
canReply?: boolean;
|
||||
onActivate?: INotificationCallback;
|
||||
}
|
||||
};
|
||||
|
||||
class NativeNotifications {
|
||||
_macNotificationsByTag = {};
|
||||
|
@ -127,7 +132,7 @@ class NativeNotifications {
|
|||
body,
|
||||
tag,
|
||||
canReply,
|
||||
onActivate = args => { },
|
||||
onActivate = args => {},
|
||||
}: INotificationOptions = {}) {
|
||||
let notif = null;
|
||||
|
||||
|
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Loading…
Reference in a new issue