| 41 | } |
| 42 | |
| 43 | _initMenuWindow() { |
| 44 | var windowOptions = util._extend({ |
| 45 | width: 200, |
| 46 | height: 100, |
| 47 | frame: false, |
| 48 | transparent: true, |
| 49 | resizable: false, |
| 50 | toolbar: false, |
| 51 | show: false, |
| 52 | 'show_in_taskbar': process.platform == "darwin" |
| 53 | }, this.menuWndowOptions); |
| 54 | |
| 55 | this.trayMenu = gui.Window.open(this.menuWindowPath, windowOptions); |
| 56 | |
| 57 | // add class to new window's body to apply platform specific css |
| 58 | this.trayMenu.on('document-end', function() { |
| 59 | this.trayMenu.window.document.body.className += ' ' + process.platform; |
| 60 | process.emit('log', "Adding class " + process.platform); |
| 61 | }.bind(this)); |
| 62 | |
| 63 | this.trayMenu.on('blur', function () { |
| 64 | this.trayMenu.hide(); |
| 65 | this.shown = false; |
| 66 | process.emit('log', 'Hide custom menu'); |
| 67 | }.bind(this)); |
| 68 | } |
| 69 | |
| 70 | // called when user click on tray icon |
| 71 | toggleTrayMenuAt(position) { |