aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
authorAlystrasz <contact@remyraes.com>2021-12-29 23:07:14 +0100
committerAlystrasz <contact@remyraes.com>2021-12-29 23:07:14 +0100
commita9744a0c5c6eaa9e17682c18e398ff9c5cf7e0fe (patch)
tree63ca1cdcd43a449b1c726bfd7b0f5c809ef2b58e /src/index.js
parent220e890af373daa5765026f7b2e60e66b38fb189 (diff)
parent474f2ae54000463a0a2dfc84ad678a7620cc3d44 (diff)
downloadViper-a9744a0c5c6eaa9e17682c18e398ff9c5cf7e0fe.tar.gz
Viper-a9744a0c5c6eaa9e17682c18e398ff9c5cf7e0fe.zip
Merge branch 'main' into chore/french-translation
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js
index fead15b..74f776c 100644
--- a/src/index.js
+++ b/src/index.js
@@ -9,9 +9,10 @@ const utils = require("./utils");
const cli = require("./cli");
function start() {
+ let width = 115;
win = new BrowserWindow({
width: 600,
- height: 115,
+ height: width,
show: false,
title: "Viper",
resizable: false,
@@ -26,10 +27,15 @@ 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()})