Browse Source

【菜单栏】PDF - 高亮Form表单域 和 高亮链接,如果有被勾选,前面需要显示✅

liujiajie 10 months ago
parent
commit
b451803c24

+ 14 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -1461,6 +1461,20 @@ extension KMMainViewController: NSMenuItemValidation, NSMenuDelegate {
             }
         }
         
+        if menuItem.action == #selector(highlightFormFiled) {
+            let enabled = CPDFKitConfig.sharedInstance().enableFormFieldHighlight()
+            menuItem.state = enabled ? .on : .off
+            
+            return true
+        }
+        
+        if menuItem.action == #selector(highlightLinks) {
+            let enabled = CPDFKitConfig.sharedInstance().enableLinkFieldHighlight()
+            menuItem.state = enabled ? .on : .off
+            
+            return true
+        }
+        
         guard let action = menuItem.action else {
             return false
         }