diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js index 3d50cee..8343ba9 100644 --- a/src/index.js +++ b/src/index.js @@ -9,8 +9,9 @@ const utils = require("./utils"); const cli = require("./cli"); function start() { + let width = 600; win = new BrowserWindow({ - width: 600, + width: width, height: 115, show: false, title: "Viper", @@ -27,13 +28,19 @@ function start() { win.removeMenu(); win.loadFile(__dirname + "/app/index.html"); - win.webContents.once("dom-ready", () => {win.show()}); - ipcMain.on("setpath", (event) => {utils.setpath(win)}) ipcMain.on("exit", (event) => {process.exit(0)}) + ipcMain.on("setpath", (event) => {utils.setpath(win)}) + ipcMain.on("setsize", (event, height) => { + win.setSize(width, height); + if (! win.isVisible()) { + win.show(); + } + }) } ipcMain.on("launch", (event) => {utils.launch()}) +ipcMain.on("setlang", (event, lang) => {utils.setlang(lang)}) ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")}) ipcMain.on("update", (event) => {utils.update()}) |