mirror of
https://github.com/overte-org/overte.git
synced 2025-07-05 01:49:29 +02:00
Merge branch 'console' of github.com:birarda/hifi into console
This commit is contained in:
commit
1b85327e4a
4 changed files with 16 additions and 1 deletions
|
@ -6,6 +6,8 @@ var events = require('events');
|
||||||
var electron = require('electron');
|
var electron = require('electron');
|
||||||
var app = electron.app; // Module to control application life.
|
var app = electron.app; // Module to control application life.
|
||||||
var BrowserWindow = require('browser-window'); // Module to create native browser window.
|
var BrowserWindow = require('browser-window'); // Module to create native browser window.
|
||||||
|
var Menu = require('menu');
|
||||||
|
var Tray = require('tray');
|
||||||
var childProcess = require('child_process');
|
var childProcess = require('child_process');
|
||||||
|
|
||||||
const ipcMain = electron.ipcMain;
|
const ipcMain = electron.ipcMain;
|
||||||
|
@ -16,6 +18,9 @@ require('crash-reporter').start();
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
// be closed automatically when the JavaScript object is garggbage collected.
|
// be closed automatically when the JavaScript object is garggbage collected.
|
||||||
var mainWindow = null;
|
var mainWindow = null;
|
||||||
|
var appIcon = null;
|
||||||
|
var TRAY_ICON = 'resources/tray-icon.png';
|
||||||
|
var APP_ICON = 'resources/tray-icon.png';
|
||||||
|
|
||||||
const ProcessStates = {
|
const ProcessStates = {
|
||||||
STOPPED: 'stopped',
|
STOPPED: 'stopped',
|
||||||
|
@ -115,8 +120,18 @@ app.on('window-all-closed', function() {
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
app.on('ready', function() {
|
app.on('ready', function() {
|
||||||
|
// Create tray icon
|
||||||
|
appIcon = new Tray(TRAY_ICON);
|
||||||
|
appIcon.setToolTip('High Fidelity Console');
|
||||||
|
var contextMenu = Menu.buildFromTemplate([{
|
||||||
|
label: 'Quit',
|
||||||
|
accelerator: 'Command+Q',
|
||||||
|
click: function() { app.quit(); }
|
||||||
|
}]);
|
||||||
|
appIcon.setContextMenu(contextMenu);
|
||||||
|
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new BrowserWindow({width: 800, height: 600});
|
mainWindow = new BrowserWindow({width: 800, height: 600, icon: APP_ICON});
|
||||||
|
|
||||||
// and load the index.html of the app.
|
// and load the index.html of the app.
|
||||||
mainWindow.loadURL('file://' + __dirname + '/index.html');
|
mainWindow.loadURL('file://' + __dirname + '/index.html');
|
||||||
|
|
BIN
console/resources/tray-icon.png
Normal file
BIN
console/resources/tray-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
console/resources/tray-icon@2x.png
Normal file
BIN
console/resources/tray-icon@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
console/resources/tray-icon@4x.png
Normal file
BIN
console/resources/tray-icon@4x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
Loading…
Reference in a new issue