Using masked Autotype sequence in Candiate Selection window again but non-interactive

This commit is contained in:
Michael Starke
2019-03-01 22:03:39 +01:00
parent 1399a8d142
commit 342acfda59
3 changed files with 5 additions and 4 deletions

View File

@@ -1,3 +1,3 @@
github "sparkle-project/Sparkle" ~> 1.18.1 github "sparkle-project/Sparkle" ~> 1.18.1
github "MacPass/KeePassKit" ~> 2.3 github "MacPass/KeePassKit" ~> 2.4
github "mstarke/HNHUi" ~> 3.0 github "mstarke/HNHUi" ~> 3.0

View File

@@ -1,4 +1,4 @@
github "MacPass/KeePassKit" "2.3.9" github "MacPass/KeePassKit" "2.4.0"
github "mstarke/HNHUi" "3.0" github "mstarke/HNHUi" "3.0"
github "robbiehanson/KissXML" "5.2.3" github "robbiehanson/KissXML" "5.2.3"
github "sparkle-project/Sparkle" "1.20.0" github "sparkle-project/Sparkle" "1.20.0"

View File

@@ -55,8 +55,9 @@
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
NSTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; NSTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
MPAutotypeContext *context = self.candidates[row]; MPAutotypeContext *context = self.candidates[row];
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ (%@)\n%@", context.entry.title, context.entry.username, context.command]]; NSString *maskedEvaluatedCommand = context.maskedEvaluatedCommand;
[string setAttributes:@{NSForegroundColorAttributeName: NSColor.disabledControlTextColor} range:NSMakeRange((string.length - context.command.length), context.command.length)]; NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@", context.entry.title, maskedEvaluatedCommand]];
[string setAttributes:@{NSForegroundColorAttributeName: NSColor.disabledControlTextColor} range:NSMakeRange((string.length - maskedEvaluatedCommand.length), maskedEvaluatedCommand.length)];
view.textField.attributedStringValue = string; view.textField.attributedStringValue = string;
view.imageView.image = context.entry.iconImage; view.imageView.image = context.entry.iconImage;
return view; return view;