From ec65eb9ceabb92d607b09b1ba8c02eeb670ce23c Mon Sep 17 00:00:00 2001 From: derouet2018 <tristan.derouet@gmail.com> Date: Thu, 11 Nov 2021 22:09:42 +0100 Subject: [PATCH] Added config file to deal with windows users --- config.json | 3 +++ main.js | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 config.json diff --git a/config.json b/config.json new file mode 100644 index 0000000..dc167e7 --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +{ + "isWindows":false +} \ No newline at end of file diff --git a/main.js b/main.js index 5b4868f..0f11a51 100644 --- a/main.js +++ b/main.js @@ -104,13 +104,22 @@ function defaultWindowOptions(title) { function createInstanceWindow() { /* Main window */ + const data = fs.readFileSync("./config.json"); + const json = data.toString('utf8'); + settings = JSON.parse(json); const opt = defaultWindowOptions('Amadeus'); opt.width = 1280; opt.height = 720; opt.minWidth = 1000; opt.minHeight = 360; opt.menuBarVisible = false; - opt.frame = false; + if(!settings.isWindows){ + opt.frame = false; + } + else{ + opt.frame = true; + opt.autoHideMenuBar = true; + } opt.webPreferences.contextIsolation = false; /* XXX: Otherwise 'require' is not defined in instance/index.html */ win = new BrowserWindow(opt); win.loadURL(`file://${__dirname}/instance/index.ejs`); -- GitLab