Added tooltip to TouchID enabled button. This is a first attempt

to make it better to understand what the mixed state is all about.
This commit is contained in:
Julius Zint
2021-02-14 17:56:29 +01:00
parent c5e30a0fa0
commit 7b79c0b814

View File

@@ -95,6 +95,7 @@ static NSMutableDictionary* touchIDSecuredPasswords;
if (@available(macOS 10.13.4, *)) {
self.touchIdEnabled.hidden = false;
self.touchIdEnabled.state = [NSUserDefaults.standardUserDefaults integerForKey:kMPSettingsKeyEntryTouchIdEnabled];
[self _updateTouchIdTooltip];
}
[self _reset];
}
@@ -341,6 +342,19 @@ static NSMutableDictionary* touchIDSecuredPasswords;
- (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 {