mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-30 13:03:53 +01:00
Allow app to start minimized (as tray icon) (#169)
* Allow app to start minimized (as tray icon) * Rever german locale
This commit is contained in:
parent
b55ab576ef
commit
a380188120
@ -53,6 +53,16 @@
|
||||
<small class="help-block">{{'enableMinToTrayDesc' | i18n}}</small>
|
||||
</div>
|
||||
<div class="form-group" *ngIf="showMinToTray">
|
||||
<div class="checkbox">
|
||||
<label for="startMinimized">
|
||||
<input id="startMinimized" type="checkbox" name="StartMinimized"
|
||||
[(ngModel)]="startMinimized" (change)="saveStartMinimized()">
|
||||
{{'startMinimized' | i18n}}
|
||||
</label>
|
||||
</div>
|
||||
<small class="help-block">{{'startMinimizedDesc' | i18n}}</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label for="enableCloseToTray">
|
||||
<input id="enableCloseToTray" type="checkbox" name="EnableCloseToTray"
|
||||
|
@ -32,6 +32,7 @@ export class SettingsComponent implements OnInit {
|
||||
enableCloseToTray: boolean = false;
|
||||
enableTray: boolean = false;
|
||||
showMinToTray: boolean = false;
|
||||
startMinimized: boolean = false;
|
||||
locale: string;
|
||||
lockOptions: any[];
|
||||
localeOptions: any[];
|
||||
@ -80,6 +81,7 @@ export class SettingsComponent implements OnInit {
|
||||
this.enableMinToTray = await this.storageService.get<boolean>(ElectronConstants.enableMinimizeToTrayKey);
|
||||
this.enableCloseToTray = await this.storageService.get<boolean>(ElectronConstants.enableCloseToTrayKey);
|
||||
this.enableTray = await this.storageService.get<boolean>(ElectronConstants.enableTrayKey);
|
||||
this.startMinimized = await this.storageService.get<boolean>(ElectronConstants.enableStartMinimizedKey);
|
||||
this.locale = await this.storageService.get<string>(ConstantsService.localeKey);
|
||||
this.theme = await this.storageService.get<string>(ConstantsService.themeKey);
|
||||
}
|
||||
@ -111,6 +113,11 @@ export class SettingsComponent implements OnInit {
|
||||
this.messagingService.send(this.enableTray ? 'showTray' : 'removeTray');
|
||||
}
|
||||
|
||||
async saveStartMinimized() {
|
||||
await this.storageService.save(ElectronConstants.enableStartMinimizedKey, this.startMinimized);
|
||||
this.callAnalytics('StartMinimized', this.startMinimized);
|
||||
}
|
||||
|
||||
async saveLocale() {
|
||||
await this.storageService.save(ConstantsService.localeKey, this.locale);
|
||||
this.analytics.eventTrack.next({ action: 'Set Locale ' + this.locale });
|
||||
|
@ -821,6 +821,12 @@
|
||||
"enableTrayDesc": {
|
||||
"message": "Always show an icon in the system tray."
|
||||
},
|
||||
"startMinimized": {
|
||||
"message": "Start minimized"
|
||||
},
|
||||
"startMinimizedDesc": {
|
||||
"message": "When starting the application, it will only show an icon in the system tray."
|
||||
},
|
||||
"language": {
|
||||
"message": "Language"
|
||||
},
|
||||
|
@ -12,6 +12,7 @@ import { MessagingMain } from './main/messaging.main';
|
||||
import { PowerMonitorMain } from './main/powerMonitor.main';
|
||||
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
import { ElectronConstants } from 'jslib/electron/electronConstants';
|
||||
import { LowdbStorageService } from 'jslib/services/lowdbStorage.service';
|
||||
|
||||
import { KeytarStorageListener } from 'jslib/electron/keytarStorageListener';
|
||||
@ -103,6 +104,10 @@ export class Main {
|
||||
click: () => this.messagingService.send('lockVault'),
|
||||
}]);
|
||||
await this.updaterMain.init();
|
||||
|
||||
if(await this.storageService.get<boolean>(ElectronConstants.enableStartMinimizedKey)) {
|
||||
this.trayMain.hideToTray();
|
||||
}
|
||||
}, (e: any) => {
|
||||
// tslint:disable-next-line
|
||||
console.error(e);
|
||||
|
Loading…
Reference in New Issue
Block a user