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

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