From 474f2ae54000463a0a2dfc84ad678a7620cc3d44 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Wed, 29 Dec 2021 22:59:47 +0100 Subject: proper responsiveness for all languages This should more or less ensure everything remains responsive even if the language is one with very long strings. --- src/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/index.js') 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()}) -- cgit v1.2.3