diff --git a/gui/main.js b/gui/main.js index 9fcecd64..12c7e961 100644 --- a/gui/main.js +++ b/gui/main.js @@ -44,8 +44,10 @@ var configContent = ` "rigctld_ip" : "127.0.0.1", "enable_scatter" : "False", "enable_fft" : "False", - "low_bandwith_mode" : "False" - "theme" : "default" + "low_bandwith_mode" : "False", + "theme" : "default", + "screen_height" : 1050, + "screen_width" : 430 } `; if (!fs.existsSync(configPath)) { @@ -100,8 +102,8 @@ var daemonProcess = null; function createWindow() { win = new BrowserWindow({ - width: 1050, - height: 430, + width: config.screen_width, + height: config.screen_height, autoHideMenuBar: true, icon: __dirname + '/src/icon_cube_border.png', webPreferences: { diff --git a/gui/preload-main.js b/gui/preload-main.js index d4127010..083b943f 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -428,10 +428,17 @@ window.addEventListener('DOMContentLoaded', () => { config.theme = theme; fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); - - //document.getElementById("css1").href = "demo2.css"; }); + //screen size + window.addEventListener('resize',() => { + + config.screen_height = window.innerHeight; + config.screen_width = window.innerWidth; + fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); + }); + + // Stop beacon button clicked document.getElementById("stopBeacon").addEventListener("click", () => { sock.stopBeacon();