1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00: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:
h44z
2019-02-02 18:16:32 +01:00
committed by Kyle Spearrin
parent b55ab576ef
commit a380188120
4 changed files with 28 additions and 0 deletions

View File

@@ -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"

View File

@@ -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 });