mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 16:38:14 +00:00
Added double click action to select the group of the currently selected entry.
This feature is mainly aimed to ease navigation when browsing search results
This commit is contained in:
@@ -143,6 +143,22 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
}
|
||||
}
|
||||
|
||||
- (void)selectGroup:(KPKGroup *)group {
|
||||
NSMutableArray *parents = [[NSMutableArray alloc] init];
|
||||
NSUUID *groupUUID = group.uuid;
|
||||
while(group.parent) {
|
||||
[parents insertObject:group.parent atIndex:0];
|
||||
group = group.parent;
|
||||
}
|
||||
NSTreeNode *node = [self.outlineView itemAtRow:0];
|
||||
for(KPKGroup *group in parents) {
|
||||
NSUInteger row = [self _rowForUUID:group.uuid node:node];
|
||||
[self.outlineView expandItem:[self.outlineView itemAtRow:row]];
|
||||
}
|
||||
NSUInteger rowToSelect = [self _rowForUUID:groupUUID node:node];
|
||||
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:rowToSelect] byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
- (void)_expandItems:(NSTreeNode *)node {
|
||||
id nodeItem = node.representedObject;
|
||||
if([nodeItem isKindOfClass:KPKTree.class]) {
|
||||
|
||||
Reference in New Issue
Block a user