1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

Add setting for toggling hide dock

This commit is contained in:
Hinton 2020-11-20 14:05:50 +01:00
parent ac05ec4afc
commit 002dd2752b
3 changed files with 24 additions and 0 deletions

View File

@ -128,6 +128,16 @@
</div> </div>
<small class="help-block">{{'startToTrayDesc' | i18n}}</small> <small class="help-block">{{'startToTrayDesc' | i18n}}</small>
</div> </div>
<div class="form-group" *ngIf="showHideDock">
<div class="checkbox">
<label for="hideDock">
<input id="hideDock" type="checkbox" name="HideDock" [(ngModel)]="hideDock"
(change)="saveHideDock()">
{{'hideDock' | i18n}}
</label>
</div>
<small class="help-block">{{'hideDockDesc' | i18n}}</small>
</div>
<div class="form-group"> <div class="form-group">
<label for="theme">{{'theme' | i18n}}</label> <label for="theme">{{'theme' | i18n}}</label>
<select id="theme" name="Theme" [(ngModel)]="theme" (change)="saveTheme()"> <select id="theme" name="Theme" [(ngModel)]="theme" (change)="saveTheme()">

View File

@ -51,6 +51,8 @@ export class SettingsComponent implements OnInit {
supportsBiometric: boolean; supportsBiometric: boolean;
biometric: boolean; biometric: boolean;
biometricText: string; biometricText: string;
hideDock: boolean;
showHideDock: boolean = false;
constructor(private analytics: Angulartics2, private toasterService: ToasterService, constructor(private analytics: Angulartics2, private toasterService: ToasterService,
private i18nService: I18nService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
@ -131,6 +133,8 @@ export class SettingsComponent implements OnInit {
this.supportsBiometric = await this.platformUtilsService.supportsBiometric(); this.supportsBiometric = await this.platformUtilsService.supportsBiometric();
this.biometric = await this.vaultTimeoutService.isBiometricLockSet(); this.biometric = await this.vaultTimeoutService.isBiometricLockSet();
this.biometricText = await this.storageService.get<string>(ConstantsService.biometricText); this.biometricText = await this.storageService.get<string>(ConstantsService.biometricText);
this.hideDock = await this.storageService.get<boolean>(ElectronConstants.hideDock);
this.showHideDock = this.platformUtilsService.getDevice() === DeviceType.MacOsDesktop;
} }
async saveVaultTimeoutOptions() { async saveVaultTimeoutOptions() {
@ -277,6 +281,10 @@ export class SettingsComponent implements OnInit {
}); });
} }
async saveHideDock() {
await this.storageService.save(ElectronConstants.hideDock, this.hideDock);
}
private callAnalytics(name: string, enabled: boolean) { private callAnalytics(name: string, enabled: boolean) {
const status = enabled ? 'Enabled' : 'Disabled'; const status = enabled ? 'Enabled' : 'Disabled';
this.analytics.eventTrack.next({ action: `${status} ${name}` }); this.analytics.eventTrack.next({ action: `${status} ${name}` });

View File

@ -870,6 +870,12 @@
"startToTrayDesc": { "startToTrayDesc": {
"message": "When the application is first started, only show an icon in the system tray." "message": "When the application is first started, only show an icon in the system tray."
}, },
"hideDock": {
"message": "Hide dock icon"
},
"hideDockDesc": {
"message": "Hide Bitwarden from the Dock when minimized to the menu bar."
},
"language": { "language": {
"message": "Language" "message": "Language"
}, },