Skip to content

Commit

Permalink
tray and app icon path with: path.join(__dirname,...)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani3lSun authored and Dani3lSun committed Jan 17, 2016
1 parent efd2f13 commit 5aa5978
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ var app = require('app');
var BrowserWindow = require('browser-window');
var appMenu = require("menu");
var appTray = require("tray");
var path = require("path");
app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
// Crash Reporter (Optional)
require('crash-reporter').start({
Expand All @@ -182,7 +183,7 @@ app.on('mainWindow-all-closed', function() {
});
// App is loaded
app.on('ready', function() {
// Tray icon not on OSX
// Tray icon
// template
var trayTemplate = [{
label: "About Application",
Expand All @@ -194,7 +195,7 @@ app.on('ready', function() {
}
}];
// set tray icon with context menu
appIcon = new appTray('img/tray.png');
appIcon = new appTray(path.join(__dirname, 'img/tray.png'));
appIcon.setContextMenu(appMenu.buildFromTemplate(trayTemplate));
// Create the main window for the app
mainWindow = new BrowserWindow({
Expand All @@ -206,7 +207,7 @@ app.on('ready', function() {
"use-content-size": true,
"transparent": true, // better look in OSX
"title-bar-style": "hidden-inset", // better look in OSX
"icon": "img/app.png" // app icon (for linux build)
"icon": path.join(__dirname, 'img/tray.png') // app icon (for linux build)
});
// Load in content with webview to APEX app
mainWindow.loadURL('file://' + __dirname + '/index.html');
Expand Down Expand Up @@ -311,7 +312,7 @@ app.on('activate', function(e, hasVisibleWindows) {
"use-content-size": true,
"transparent": true, // better look in OSX
"title-bar-style": "hidden-inset", // better look in OSX
"icon": "img/app.png" // app icon (for linux build)
"icon": path.join(__dirname, 'img/tray.png') // app icon (for linux build)
});
mainWindow.loadURL('file://' + __dirname + '/index.html');
mainWindow.on('closed', function() {
Expand Down
9 changes: 5 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var app = require('app');
var BrowserWindow = require('browser-window');
var appMenu = require("menu");
var appTray = require("tray");
var path = require("path");
app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
// Crash Reporter (Optional)
require('crash-reporter').start({
Expand All @@ -22,7 +23,7 @@ app.on('mainWindow-all-closed', function() {
});
// App is loaded
app.on('ready', function() {
// Tray icon not on OSX
// Tray icon
// template
var trayTemplate = [{
label: "About Application",
Expand All @@ -34,7 +35,7 @@ app.on('ready', function() {
}
}];
// set tray icon with context menu
appIcon = new appTray('img/tray.png');
appIcon = new appTray(path.join(__dirname, 'img/tray.png'));
appIcon.setContextMenu(appMenu.buildFromTemplate(trayTemplate));
// Create the main window for the app
mainWindow = new BrowserWindow({
Expand All @@ -46,7 +47,7 @@ app.on('ready', function() {
"use-content-size": true,
"transparent": true, // better look in OSX
"title-bar-style": "hidden-inset", // better look in OSX
"icon": "img/app.png" // app icon (for linux build)
"icon": path.join(__dirname, 'img/tray.png') // app icon (for linux build)
});
// Load in content with webview to APEX app
mainWindow.loadURL('file://' + __dirname + '/index.html');
Expand Down Expand Up @@ -151,7 +152,7 @@ app.on('activate', function(e, hasVisibleWindows) {
"use-content-size": true,
"transparent": true, // better look in OSX
"title-bar-style": "hidden-inset", // better look in OSX
"icon": "img/app.png" // app icon (for linux build)
"icon": path.join(__dirname, 'img/tray.png') // app icon (for linux build)
});
mainWindow.loadURL('file://' + __dirname + '/index.html');
mainWindow.on('closed', function() {
Expand Down

0 comments on commit 5aa5978

Please sign in to comment.