Using NSSplitViewController for main split view.

This commit is contained in:
Michael Starke
2020-01-31 16:30:13 +01:00
parent b028ef51f9
commit e3352efe49
8 changed files with 186 additions and 164 deletions

View File

@@ -225,6 +225,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
#pragma mark Notifications
- (void)registerNotificationsForDocument:(MPDocument *)document {
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didAddGroup:) name:MPDocumentDidAddGroupNotification object:document];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didRevertDocument:) name:MPDocumentDidRevertNotifiation object:document];
}
- (void)clearSelection {
@@ -268,6 +269,9 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:groupRow] byExtendingSelection:NO];
[self.outlineView scrollRowToVisible:groupRow];
}
- (void)_didRevertDocument:(NSNotification *)notification {
[self clearSelection];
}
- (id)itemUnderMouse {
NSPoint mouseLocation = [self.outlineView.window mouseLocationOutsideOfEventStream];