-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
49 lines (42 loc) · 1.47 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*=======================================================================
Main.js : point d'antrée de l'application Electron.
voir : https://github.com/atom/electron/blob/master/docs/api
=======================================================================*/
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native var
var ipc = require('ipc');
var mainWindow = null;
var configWindow = null;
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit();
}
});
app.on('ready', function() {
if (app.dock && app.dock.hide)
app.dock.hide();
mainWindow = new BrowserWindow({
x: -1270,y: 1,
width: 230, height: 280,
frame: false,
'title-bar-style': 'hidden',
//transparent: true
});
mainWindow.loadUrl('file://' + __dirname + '/index.html');
//mainWindow.webContents.openDevTools();// DEBUG
mainWindow.on('closed', function() { mainWindow = null; });
ipc.on("showConfig", function() {
if (configWindow) {
configWindow.close();
return;
}
configWindow = new BrowserWindow({
x: -1000,y: 100,
width: 1000, height: 800,
show: true
});
configWindow.loadUrl('file://' + __dirname + '/config.html');
configWindow.on('closed', function() { configWindow = null; });
});
ipc.on("hideConfig", function() { configWindow.hide();});
});