1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

more tray icon options

This commit is contained in:
Kyle Spearrin
2018-05-05 00:29:02 -04:00
parent 4fd597fc05
commit 9d969929de
8 changed files with 127 additions and 37 deletions

View File

@@ -32,6 +32,16 @@
</div>
<small class="help-block">{{'disableFaviconDesc' | i18n}}</small>
</div>
<div class="form-group">
<div class="checkbox">
<label for="enableTray">
<input id="enableTray" type="checkbox" name="EnableTray"
[(ngModel)]="enableTray" (change)="saveTray()">
{{'enableTray' | i18n}}
</label>
</div>
<small class="help-block">{{'enableTrayDesc' | i18n}}</small>
</div>
<div class="form-group">
<div class="checkbox">
<label for="enableMinToTray">

View File

@@ -15,7 +15,7 @@ import { StorageService } from 'jslib/abstractions/storage.service';
import { ConstantsService } from 'jslib/services/constants.service';
import { DesktopConstants } from '../../desktopConstants';
import { ElectronConstants } from 'jslib/electron/electronConstants';
@Component({
selector: 'app-settings',
@@ -26,6 +26,7 @@ export class SettingsComponent implements OnInit {
disableGa: boolean = false;
disableFavicons: boolean = false;
enableMinToTray: boolean = false;
enableTray: boolean = false;
locale: string;
lockOptions: any[];
localeOptions: any[];
@@ -58,7 +59,8 @@ export class SettingsComponent implements OnInit {
async ngOnInit() {
this.lockOption = await this.storageService.get<number>(ConstantsService.lockOptionKey);
this.disableFavicons = await this.storageService.get<boolean>(ConstantsService.disableFaviconKey);
this.enableMinToTray = await this.storageService.get<boolean>(DesktopConstants.enableMinimizeToTrayKey);
this.enableMinToTray = await this.storageService.get<boolean>(ElectronConstants.enableMinimizeToTrayKey);
this.enableTray = await this.storageService.get<boolean>(ElectronConstants.enableTrayKey);
this.locale = await this.storageService.get<string>(ConstantsService.localeKey);
const disableGa = await this.storageService.get<boolean>(ConstantsService.disableGaKey);
@@ -88,10 +90,16 @@ export class SettingsComponent implements OnInit {
}
async saveMinToTray() {
await this.storageService.save(DesktopConstants.enableMinimizeToTrayKey, this.enableMinToTray);
await this.storageService.save(ElectronConstants.enableMinimizeToTrayKey, this.enableMinToTray);
this.callAnalytics('MinimizeToTray', this.enableMinToTray);
}
async saveTray() {
await this.storageService.save(ElectronConstants.enableTrayKey, this.enableTray);
this.callAnalytics('Tray', this.enableTray);
this.messagingService.send(this.enableTray ? 'showTray' : 'removeTray');
}
async saveLocale() {
await this.storageService.save(ConstantsService.localeKey, this.locale);
this.analytics.eventTrack.next({ action: 'Set Locale ' + this.locale });