Browse Source

【综合】大纲列表补充点击事件

tangchao 1 year ago
parent
commit
302e2a6d2d

+ 0 - 32
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -260,38 +260,6 @@
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "7A815601-D92D-4133-9AD5-135810C22224"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "125"
-            endingLineNumber = "125"
-            landmarkName = "-goToDestination:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "E3D2735D-BC29-49D0-8560-DAA6C7C1EBB1"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "129"
-            endingLineNumber = "129"
-            landmarkName = "-goToRect:onPage:animated:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent

+ 26 - 20
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -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?) {

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/LeftSideView.xib

@@ -1133,7 +1133,7 @@
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="z3N-jy-sfp">
                 <rect key="frame" x="0.0" y="0.0" width="231" height="429"/>
-                <autoresizingMask key="autoresizingMask"/>
+                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                 <subviews>
                     <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" tableStyle="fullWidth" typeSelect="NO" autosaveName="KMNoteOutlineView" rowHeight="92" usesAutomaticRowHeights="YES" viewBased="YES" indentationPerLevel="16" outlineTableColumn="yso-Z1-ZNZ" id="ZeT-gb-jMM" customClass="KMNoteOutlineView" customModule="PDF_Master" customModuleProvider="target">
                         <rect key="frame" x="0.0" y="0.0" width="231" height="429"/>
@@ -1341,7 +1341,7 @@
         <image name="KMImageNameBtnSidebarRankPositive" width="16" height="16"/>
         <image name="KMImageNameBtnTriRightNor" width="16" height="16"/>
         <image name="KMImageNameEmptySearch" width="140" height="140"/>
-        <image name="KMImageNameUXIconBtnArrowDown" width="16" height="16"/>
+        <image name="KMImageNameUXIconBtnArrowDown" width="17" height="16"/>
         <image name="KMImageNameUXIconBtnSidebarAddNor" width="16" height="16"/>
         <image name="KMImageNameUXIconBtnSidebarFilterNor" width="16" height="16"/>
         <image name="KMImageNameUXIconBtnSidebarMoreNor" width="16" height="16"/>