enhanced right click target resolving in entry table

If an item is right clicked, it would be the target of an action regardless of selection,
now, if there is a  selection and the right-clicked item is contained in this selection, every item is the target,
otherwise, only the right clicked target is used.
This commit is contained in:
michael starke
2017-09-29 13:24:46 +02:00
parent df3d9b408f
commit c47d215a1b

View File

@@ -391,7 +391,9 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
- (NSArray<KPKEntry *> *)currentTargetEntries {
NSInteger activeRow = self.entryTable.clickedRow;
if(activeRow > -1 && activeRow < [self.entryArrayController.arrangedObjects count]) {
return @[ [self.entryArrayController arrangedObjects][activeRow] ];
if(![self.entryArrayController.selectionIndexes containsIndex:activeRow]) {
return @[ [self.entryArrayController arrangedObjects][activeRow] ];
}
}
return self.entryArrayController.selectedObjects;
}