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
2 changed files with 15 additions and 6 deletions
10
gui/main.js
10
gui/main.js
|
@ -44,8 +44,10 @@ var configContent = `
|
||||||
"rigctld_ip" : "127.0.0.1",
|
"rigctld_ip" : "127.0.0.1",
|
||||||
"enable_scatter" : "False",
|
"enable_scatter" : "False",
|
||||||
"enable_fft" : "False",
|
"enable_fft" : "False",
|
||||||
"low_bandwith_mode" : "False"
|
"low_bandwith_mode" : "False",
|
||||||
"theme" : "default"
|
"theme" : "default",
|
||||||
|
"screen_height" : 1050,
|
||||||
|
"screen_width" : 430
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
if (!fs.existsSync(configPath)) {
|
if (!fs.existsSync(configPath)) {
|
||||||
|
@ -100,8 +102,8 @@ var daemonProcess = null;
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
win = new BrowserWindow({
|
win = new BrowserWindow({
|
||||||
width: 1050,
|
width: config.screen_width,
|
||||||
height: 430,
|
height: config.screen_height,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
icon: __dirname + '/src/icon_cube_border.png',
|
icon: __dirname + '/src/icon_cube_border.png',
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
|
|
@ -428,10 +428,17 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||||
config.theme = theme;
|
config.theme = theme;
|
||||||
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
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
|
// Stop beacon button clicked
|
||||||
document.getElementById("stopBeacon").addEventListener("click", () => {
|
document.getElementById("stopBeacon").addEventListener("click", () => {
|
||||||
sock.stopBeacon();
|
sock.stopBeacon();
|
||||||
|
|
Loading…
Reference in a new issue