でかいアイコン表示するとメニューバーがそれで埋まってしまうw
Windowsはアイコンサイズ調整してくれるのにねぇ
Retina向けのサイズ
正方形だと18x18当たりが狙い目の模様
convert -geometry 18x18 iconOriginalSize.png icon.png
main.js
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var Menu = require('menu');
var Tray = require('tray');
var appIcon = null;
var contextMenu = null;
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the javascript object is GCed.
var mainWindow = null;
// Quit when all windows are closed.
app.on('window-all-closed', function() {
if (process.platform != 'darwin')
app.quit();
});
// This method will be called when atom-shell has done everything
// initialization and ready for creating browser windows.
app.on('ready', function() {
appIcon = new Tray(__dirname + '/icon.png');
contextMenu = Menu.buildFromTemplate([{
label: 'Item1',
type: 'radio'
}, {
label: 'Item2',
type: 'radio'
}, {
label: 'Item3',
type: 'radio',
checked: true
}, {
label: 'Item4',
type: 'radio'
}, ]);
appIcon.setToolTip('This is my application.');
appIcon.setContextMenu(contextMenu);
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600
});
// and load the index.html of the app.
mainWindow.loadUrl('about://blank');
mainWindow.openDevTools();
// Emitted when the window is closed.
mainWindow.on('closed', function() {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});