aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
authorAlystrasz <contact@remyraes.com>2021-12-30 00:19:21 +0100
committerAlystrasz <contact@remyraes.com>2021-12-30 00:19:21 +0100
commit869fef7de703174b5b0e0eadc6565a8963bb6bfc (patch)
tree6d0cfb1c6c1dcec1f53b8853474f4910db17bdbe /src/index.js
parent9df37da13c5eeba92ceeed7a5e9ffbaed976a615 (diff)
parentfabfee3a0b845a9b58dbb59932228d6c4223aad3 (diff)
downloadViper-869fef7de703174b5b0e0eadc6565a8963bb6bfc.tar.gz
Viper-869fef7de703174b5b0e0eadc6565a8963bb6bfc.zip
Merge branch 'main' into feat/version-indicator
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js
index 56b0df4..639cbeb 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 = 600;
win = new BrowserWindow({
- width: 600,
- height: 130,
+ width: width,
+ height: 115,
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()})