Custom fields now correctly are hidden/displayed when protected attribute is set

This commit is contained in:
michael starke
2017-11-03 14:12:14 +01:00
parent 4a1b7972b2
commit 96179556dc
3 changed files with 8 additions and 3 deletions

View File

@@ -23,7 +23,7 @@
#import "MPCustomFieldTableViewDelegate.h"
#import "MPCustomFieldTableCellView.h"
#import "MPEntryInspectorViewController.h"
#import "HNHUi/HNHUi.h"
#import "KeePassKit/KeePassKit.h"
@implementation MPCustomFieldTableViewDelegate
@@ -44,6 +44,11 @@
withKeyPath:@"objectValue.isProtected"
options:nil];
[view.valueTextField bind:NSStringFromSelector(@selector(showPassword))
toObject:view
withKeyPath:@"objectValue.isProtected"
options:@{NSValueTransformerNameBindingOption: NSNegateBooleanTransformerName}];
for(NSControl *control in @[view.labelTextField, view.valueTextField, view.removeButton, view.protectedButton ]) {
[control bind:NSEnabledBinding