fix #480: option to launch the app minimized

This commit is contained in:
antelle 2019-10-06 13:14:12 +02:00
parent 769cf19d5c
commit 8c124f8980
3 changed files with 11 additions and 1 deletions

View File

@ -305,6 +305,8 @@ Events.on('launcher-exit-request', () => {
setTimeout(() => Launcher.exit(), 0);
});
Events.on('launcher-minimize', () => setTimeout(() => Events.emit('app-minimized'), 0));
Events.on('launcher-started-minimized', () => setTimeout(() => Launcher.minimizeApp(), 0));
window.launcherOpen = file => Launcher.openFile(file);
if (window.launcherOpenedFile) {
logger.info('Open file request', window.launcherOpenedFile);

View File

@ -31,8 +31,11 @@ let htmlPath = process.argv
if (!htmlPath) {
htmlPath = 'file://' + path.join(__dirname, 'index.html');
}
const showDevToolsOnStart = process.argv.some(arg => arg.startsWith('--devtools'));
const startMinimized = process.argv.some(arg => arg.startsWith('--minimized'));
const themeBgColors = {
db: '#342f2e',
fb: '#282c34',
@ -180,7 +183,11 @@ function createMainWindow() {
mainWindow.openDevTools({ mode: 'bottom' });
}
mainWindow.once('ready-to-show', () => {
mainWindow.show();
if (startMinimized) {
emitRemoteEvent('launcher-started-minimized');
} else {
mainWindow.show();
}
ready = true;
notifyOpenFile();
});

View File

@ -6,6 +6,7 @@ Release notes
`+` #963: keyboard shortcut to copy OTP in background
`+` #565: global shortcut to open KeeWeb
`+` #862: downloading attachments on mobile
`+` #480: option to launch the app minimized
`-` fix #1273: untranslated menu items
##### v1.11.6 (2019-10-04)