save screen height/width & config fix

This commit is contained in:
dj2ls 2022-02-10 15:05:04 +01:00
parent 196b18393f
commit d11610f085
2 changed files with 15 additions and 6 deletions

View file

@ -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: {

View file

@ -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();