mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 16:38:14 +00:00
Fixed issue re-selection selected groups when exiting search.
This fix is rather ugly but works for now. It should get re-evaluated when the whole selection and search model is being refactored
This commit is contained in:
@@ -49,6 +49,9 @@ NSString *const kMPDocumentSearchResultsKey = @"kMPDocumentSearchResul
|
|||||||
*/
|
*/
|
||||||
[NSNotificationCenter.defaultCenter postNotificationName:MPDocumentDidEnterSearchNotification object:self];
|
[NSNotificationCenter.defaultCenter postNotificationName:MPDocumentDidEnterSearchNotification object:self];
|
||||||
[self updateSearch:self];
|
[self updateSearch:self];
|
||||||
|
/* clear selection */
|
||||||
|
self.selectedGroups = nil;
|
||||||
|
self.selectedEntries = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark Actions
|
#pragma mark Actions
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
|||||||
NSInteger visibleRow = [self _rowForUUID:visibleUUID node:node];
|
NSInteger visibleRow = [self _rowForUUID:visibleUUID node:node];
|
||||||
selectRow = selectRow > -1 ? selectRow : 1;
|
selectRow = selectRow > -1 ? selectRow : 1;
|
||||||
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:selectRow] byExtendingSelection:NO];
|
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:selectRow] byExtendingSelection:NO];
|
||||||
|
|
||||||
if(visibleRow > -1) {
|
if(visibleRow > -1) {
|
||||||
NSRect rowRect = [self.outlineView rectOfRow:visibleRow];
|
NSRect rowRect = [self.outlineView rectOfRow:visibleRow];
|
||||||
[self.outlineView scrollPoint:rowRect.origin];
|
[self.outlineView scrollPoint:rowRect.origin];
|
||||||
@@ -225,7 +225,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
|||||||
#pragma mark Notifications
|
#pragma mark Notifications
|
||||||
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
||||||
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didAddGroup:) name:MPDocumentDidAddGroupNotification object:document];
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didAddGroup:) name:MPDocumentDidAddGroupNotification object:document];
|
||||||
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didRevertDocument:) name:MPDocumentDidRevertNotification object:document];
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didRevertDocument:) name:MPDocumentDidRevertNotification object:document];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)clearSelection {
|
- (void)clearSelection {
|
||||||
|
|||||||
Reference in New Issue
Block a user