فهرست منبع

偏好设置-高亮链接补充交互

tangchao 2 سال پیش
والد
کامیت
1d54e25429

BIN
PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate


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

@@ -356,5 +356,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "88A87966-4E0F-41A7-AF5A-E10484CF25C1"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Office/Class/PDFWindowController/PDFListView/CPDFListView.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "534"
+            endingLineNumber = "534"
+            landmarkName = "-addAnnotationWithImage:page:point:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "B24233F8-3481-4E33-B8ED-4C0BDFAE0E93"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Office/Class/PDFWindowController/PDFListView/CPDFListView.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "605"
+            endingLineNumber = "605"
+            landmarkName = "-addActiveAnnotations:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 3 - 0
PDF Office/PDF Office/Class/PDFWindowController/PDFListView/CPDFListView.h

@@ -216,4 +216,7 @@ typedef NS_ENUM(NSInteger, CToolMode) {
 
 - (BOOL)PDFListViewHaveDocumentAttribute;
 
+// 是否需要绘制注释 【文字、背景】
+- (BOOL)PDFListView:(CPDFListView *)pdfListView needDrawAnnotation:(CPDFAnnotation *)annotation;
+
 @end

+ 6 - 0
PDF Office/PDF Office/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -384,6 +384,12 @@ NSNotificationName const CPDFListViewActiveAnnotationsChangeNotification = @"CPD
 - (void)drawAnnotation:(CPDFAnnotation *)annotation toContext:(CGContextRef)context {
     [super drawAnnotation:annotation toContext:context];
     
+    if ([self.pdfListViewDelegate respondsToSelector:@selector(PDFListView:needDrawAnnotation:)]) {
+        if ([self.pdfListViewDelegate PDFListView:self needDrawAnnotation:annotation] == false) {
+            return;
+        }
+    }
+    
     if (CFormToolMode == _toolMode &&
         [annotation isKindOfClass:[CPDFWidgetAnnotation class]] && self.showFormFieldName && !annotation.isHidden) {
         

+ 3 - 0
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -47,6 +47,9 @@ extension KMMainViewController {
         if (info.keys.contains(KMGeneralAuthorNameKey)) { // 作者名称
             CPDFKitConfig.sharedInstance().setAnnotationAuthor((info[KMGeneralAuthorNameKey] as! String))
         }
+        if (info.keys.contains(KMHighlightLinksKey)) {
+            self.listView.setNeedsDisplayForVisiblePages()
+        }
     }
     
     func updatePageIndicatoreType () {

+ 7 - 0
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -1228,5 +1228,12 @@ import Cocoa
         }
 
     }
+    
+    func pdfListView(_ pdfListView: CPDFListView!, needDraw annotation: CPDFAnnotation!) -> Bool {
+        if (annotation is CPDFLinkAnnotation) {
+            return KMPreferenceManager.shared.highlightLinks
+        }
+        return true
+    }
 }