From 1318b32be643b95c386a228c4f11382fae42b453 Mon Sep 17 00:00:00 2001 From: Rita Larina Date: Sun, 22 Dec 2024 16:14:03 +0200 Subject: [PATCH 01/48] Added settings option in the app menu. Not active yet. --- main.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 9341f87..497360e 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow, ipcMain } = require('electron'); +const { app, BrowserWindow, ipcMain, Menu} = require('electron'); const fs = require('fs'); const path = require('path'); @@ -12,11 +12,29 @@ function createWindow() { nodeIntegration: true, contextIsolation: false, // Allow access to Node.js APIs in renderer }, - icon: path.join(__dirname, 'assets/icons/nutrient.ico') + icon: path.join(__dirname, 'assets/icons/nutrient.ico') }); mainWindow.loadFile('index.html'); + const template = [ + { + label: "File", + submenu: [ + { + label: "Settings", + click: () => { + mainWindow.webContents.send('open-settings-modal'); + } + }, + { role: "quit" } + ] + } + ]; + + const menu = Menu.buildFromTemplate(template); + Menu.setApplicationMenu(menu); + // Load the nutrition.xml file when the window is ready mainWindow.webContents.on('did-finish-load', () => { const nutritionFilePath = path.join(__dirname, 'assets/nutrition.xml'); From 8f930a7dde7650249320b1a0318a9bf1bc0353f2 Mon Sep 17 00:00:00 2001 From: Rita Larina Date: Sun, 22 Dec 2024 17:45:15 +0200 Subject: [PATCH 02/48] Renderer file moved to src folder --- index.html | 2 +- renderer.js => src/renderer/renderer.js | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename renderer.js => src/renderer/renderer.js (100%) diff --git a/index.html b/index.html index 7b59ec1..b2ec0cc 100644 --- a/index.html +++ b/index.html @@ -186,7 +186,7 @@

Feeding Speed

- +