aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2021-12-29 22:59:47 +0100
committer0neGal <mail@0negal.com>2021-12-29 22:59:47 +0100
commit474f2ae54000463a0a2dfc84ad678a7620cc3d44 (patch)
tree3ead3d9fb078daefed14392db88c1cb3a4af8a7e /src/index.js
parent4abe10aebdfa06c9b9c31c98f084d511e3e2e319 (diff)
downloadViper-474f2ae54000463a0a2dfc84ad678a7620cc3d44.tar.gz
Viper-474f2ae54000463a0a2dfc84ad678a7620cc3d44.zip
proper responsiveness for all languages
This should more or less ensure everything remains responsive even if the language is one with very long strings.
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()})