mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
save screen height/width & config fix
This commit is contained in:
parent
196b18393f
commit
d11610f085
10
gui/main.js
10
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: {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue