diff --git a/js/methods.js b/js/methods.js index e3263d0..2bb81f3 100644 --- a/js/methods.js +++ b/js/methods.js @@ -129,6 +129,7 @@ function preFillSettings() { // document.getElementById('start_at_boot').checked = !!settings.get('settings.start_at_boot'); document.getElementById('apply_last_settings_on_launch').checked = !!settings.get('settings.apply_last_settings_on_launch'); document.getElementById('minimize_to_tray').checked = !!settings.get('settings.minimize_to_tray'); + document.getElementById('start_minimized').checked = !!settings.get('settings.start_minimized'); seconds = parseInt(settings.get('settings.reapply_periodically')); seconds = seconds >= 0 ? seconds : 0; @@ -260,6 +261,13 @@ function registerEventListenerForSettingsInput() { minimize_to_tray: !!minimize_to_tray.checked }); }); + var start_minimized = document.getElementById('start_minimized'); + start_minimized.addEventListener('change', function() { + settings.set('settings', { + ...settings.get('settings'), + start_minimized: !!start_minimized.checked + }); + }); var reapply_periodically = document.getElementById('reapply_periodically'); reapply_periodically.addEventListener('change', function() { reApplyPeriodically(reapply_periodically.value); diff --git a/main.js b/main.js index ecad1f7..7ce025e 100644 --- a/main.js +++ b/main.js @@ -113,8 +113,12 @@ function createWindow () { webPreferences: { nodeIntegration: true }, - icon: appIcon + icon: appIcon, + show: false, }) + if (!settings.get('settings.start_minimized')) { + mainWindow.show(); + } mainWindow.setOpacity(0.95);