|
@@ -3690,6 +3690,17 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+ func outlineViewSelectionDidChange(_ notification: Notification) {
|
|
|
+ if self.tocOutlineView.isEqual(to: notification.object) {
|
|
|
+// if ([[notification object] isEqual:leftSideController.tocOutlineView] && (mwcFlags.updatingOutlineSelection == 0)){
|
|
|
+// mwcFlags.updatingOutlineSelection = 1;
|
|
|
+ self.goToSelectedOutlineItem(nil)
|
|
|
+// mwcFlags.updatingOutlineSelection = 0;
|
|
|
+// if ([self interactionMode] == SKPresentationMode && [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoHidePresentationContentsKey])
|
|
|
+// [self hideLeftSideWindow];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
#pragma mark NSOutlineView datasource protocol
|
|
|
|
|
@@ -3883,17 +3894,6 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- - (void)outlineViewSelectionDidChange:(NSNotification *)notification{
|
|
|
- // Get the destination associated with the search result list. Tell the PDFView to go there.
|
|
|
- if ([[notification object] isEqual:leftSideController.tocOutlineView] && (mwcFlags.updatingOutlineSelection == 0)){
|
|
|
- mwcFlags.updatingOutlineSelection = 1;
|
|
|
- [self goToSelectedOutlineItem:nil];
|
|
|
- mwcFlags.updatingOutlineSelection = 0;
|
|
|
- if ([self interactionMode] == SKPresentationMode && [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoHidePresentationContentsKey])
|
|
|
- [self hideLeftSideWindow];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- (NSString *)outlineView:(NSOutlineView *)ov toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)tableColumn item:(id)item mouseLocation:(NSPoint)mouseLocation {
|
|
|
if ([ov isEqual:rightSideController.noteOutlineView] &&
|
|
|
(tableColumn == nil || [[tableColumn identifier] isEqualToString:NOTE_COLUMNID])) {
|
|
@@ -4694,15 +4694,21 @@ extension KMLeftSideViewController {
|
|
|
|
|
|
extension KMLeftSideViewController {
|
|
|
@objc func goToSelectedOutlineItem(_ sender: AnyObject?) {
|
|
|
- KMPrint("KMLeftSideViewController-goToSelectedOutlineItem...")
|
|
|
-// PDFOutline *outlineItem = [leftSideController.tocOutlineView itemAtRow:[leftSideController.tocOutlineView selectedRow]];
|
|
|
-// NSOutlineView *outline = (NSOutlineView *)leftSideController.tocOutlineView;
|
|
|
-// if (outline.selectedRowIndexes.count == 1) {
|
|
|
-// if ([outlineItem destination])
|
|
|
-// [pdfView goToDestination:[outlineItem destination]];
|
|
|
-// else if ([outlineItem action])
|
|
|
-// [pdfView performAction:[outlineItem action]];
|
|
|
-// }
|
|
|
+ let outlineItem = self.tocOutlineView.item(atRow: self.tocOutlineView.selectedRow)
|
|
|
+ let outline = self.tocOutlineView
|
|
|
+ if let cnt = outline?.selectedRowIndexes.count, cnt == 1 {
|
|
|
+ if outlineItem is CPDFOutline {
|
|
|
+ let outline = (outlineItem as! CPDFOutline)
|
|
|
+ if let des = outline.destination {
|
|
|
+ self.listView.go(to: des)
|
|
|
+ } else if let action = outline.action {
|
|
|
+ self.listView.perform(action)
|
|
|
+ }
|
|
|
+ } else if outlineItem is CPDFBookmark {
|
|
|
+ let bookmark = outlineItem as! CPDFBookmark
|
|
|
+ self.listView.go(toPageIndex: bookmark.pageIndex, animated: true)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@objc func goToSelectedFindResults(_ sender: AnyObject?) {
|