浏览代码

【2025】【PDFView】偏好设置串接显示工具bar

dinglingui 1 月之前
父节点
当前提交
a006e7b062

+ 6 - 4
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -1973,7 +1973,7 @@ struct KMNMWCFlags {
     func reloadPopUIActiveAnnotations(activeAnnotations:[CPDFAnnotation]) {
         let annotationMode = KMNAnnotationPopMode(pdfAnnotations: activeAnnotations )
         let popWindow = KMNPopAnnotationWindowController.shared
-        if annotationMode.popType == .popTypeNone {
+        if annotationMode.popType == .popTypeNone || !SettingsManager.sharedInstance.showQuickActionBar {
             closeAnnotationPopWindow()
         } else {
             if popWindow.window?.isVisible == false {
@@ -2004,7 +2004,7 @@ struct KMNMWCFlags {
         let editingAreas = listView.km_EditingAreas()
         let editMode = KMNEditContentPopMode(currentEditAreas: editingAreas)
         let popWindow = KMNPopContentEditWindowController.shared
-        if editMode.popType == .editNone {
+        if editMode.popType == .editNone || !SettingsManager.sharedInstance.showQuickActionBar {
             closePopContentEditWindow()
         } else {
             listView.window?.addChildWindow(popWindow.window ?? NSWindow(), ordered: .above)
@@ -5363,7 +5363,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
         var pagePoint = CGPoint.zero
         let point = theEvent.locationInWindow
         
-        let isShowPopUI:Bool = false
+        let isShowPopUI:Bool = !SettingsManager.sharedInstance.showQuickActionBar
 
         if let page = pdfListView.pageAndPoint(&pagePoint, for: theEvent, nearest: false) {
             if view.window?.interactionMode == .presentation {
@@ -5652,7 +5652,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
             
             groupListMenuGroup?.showWithPoint(CGPoint(x: windowPoint.x, y: windowPoint.y - menuStruct.viewHeight), relativeTo: listView)
         } else {
-            let isShowPopUI:Bool = false
+            let isShowPopUI:Bool = !SettingsManager.sharedInstance.showQuickActionBar
             var menuStringArr: [String] = []
             let editingAreas = listView.km_EditingAreas()
             let firstEditingArea = editingAreas.first
@@ -6575,6 +6575,8 @@ extension KMMainViewController: ComponentGroupDelegate {
                 listView.delete(nil)
             }
         } else if(menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_ShowPopUI) {
+            UserDefaults.standard.setValue(true, forKey: settingsShowQuickActionBarKey)
+            SettingsManager.sharedInstance.showQuickActionBar = true
             reloadPopUIWindow()
         } else if(menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_LinkReade) {
         

+ 1 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/KMPDFMenuConfig.swift

@@ -1039,7 +1039,7 @@ let BOTAMenuIdentifier_Annotation_DeleteMuteRep = "BOTAMenuIdentifier_Annotation
     
     class func editFontAlighProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
         let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
-                                                                                       text: KMLocalizedString("Align"),
+                                                                                       text: KMLocalizedString("Text Alignment"),
                                                                                        identifier: PDFViewMenuIdentifier_Edit_FontAlight,representedObject: listView)
         var subMenuItemArr: [ComponentMenuitemProperty] = []
         let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘{",text: KMLocalizedString("Align Left"),identifier: PDFViewMenuIdentifier_Edit_FontLeftAlight,