Skip to content

Commit

Permalink
Added tooltip to TouchID enabled button. This is a first attempt
Browse files Browse the repository at this point in the history
to make it better to understand what the mixed state is all about.
  • Loading branch information
Julius Zint committed Feb 14, 2021
1 parent c5e30a0 commit 7b79c0b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MacPass/MPPasswordInputController.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ - (void)viewDidLoad {
if (@available(macOS 10.13.4, *)) {
self.touchIdEnabled.hidden = false;
self.touchIdEnabled.state = [NSUserDefaults.standardUserDefaults integerForKey:kMPSettingsKeyEntryTouchIdEnabled];
[self _updateTouchIdTooltip];
}
[self _reset];
}
Expand Down Expand Up @@ -341,6 +342,19 @@ - (IBAction)unlockWithTouchID:(id)sender {

- (IBAction)touchIdEnabledChanged:(id)sender {
[NSUserDefaults.standardUserDefaults setInteger: self.touchIdEnabled.state forKey:kMPSettingsKeyEntryTouchIdEnabled];
[self _updateTouchIdTooltip];
}

- (void) _updateTouchIdTooltip {
if(self.touchIdEnabled.state == NSControlStateValueOn) {
self.touchIdEnabled.toolTip = @"Unlocking via TouchID is enabled";
}
else if(self.touchIdEnabled.state == NSControlStateValueOff) {
self.touchIdEnabled.toolTip = @"Unlocking via TouchID is disabled";
}
else {
self.touchIdEnabled.toolTip = @"Unlocking via TouchID is possible until MacPass is restarted";
}
}

- (IBAction)resetKeyFile:(id)sender {
Expand Down

0 comments on commit 7b79c0b

Please sign in to comment.