Browse Source

【综合】自定义图章界面缩放逻辑优化

niehaoyu 8 months ago
parent
commit
5f31ecbbf4

+ 15 - 0
PDF Office/PDF Master/Class/PDFTools/CustomStamp/CustomStampConfig.swift

@@ -25,3 +25,18 @@ let CSLeftStampItemIdentifier  = "CSLeftStampItemIdentifier"
    
     
 }
+
+
+@objcMembers class CustomStampManager: NSObject {
+    //单例
+    public static let manager = CustomStampManager()
+    
+    var isWindowShow: Bool = false
+    
+    override init() {
+        super.init()
+        
+        
+    }
+    
+}

+ 4 - 1
PDF Office/PDF Master/Class/PDFTools/CustomStamp/CustomStampWindowController.swift

@@ -54,6 +54,8 @@ class CustomStampWindowController: NSWindowController, CPDFViewDelegate, CPDFLis
         self.window?.delegate = self
         self.window?.title = NSLocalizedString("Create Custom Stamp", comment: "")
         
+        self.addEventMonitor()
+        
         self.configPDFContendView()
         
         self.configTopToolbar()
@@ -64,7 +66,8 @@ class CustomStampWindowController: NSWindowController, CPDFViewDelegate, CPDFLis
         self.addStampButton.title = NSLocalizedString("Add Stamp", comment: "")
         
         self.updateViewColor()
-        self.addEventMonitor()
+        
+        self.window?.makeFirstResponder(self.pdfView)
     }
     
     func reloadData() {

+ 1 - 0
PDF Office/PDF Master/Class/PDFTools/CustomStamp/CustomStampWindowController.xib

@@ -27,6 +27,7 @@
             <rect key="contentRect" x="196" y="240" width="797" height="500"/>
             <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <value key="minSize" type="size" width="797" height="500"/>
+            <value key="maxSize" type="size" width="797" height="500"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="797" height="500"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 5 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/StampList/KMAnnotationStampViewController.swift

@@ -121,6 +121,8 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
     var signatures: [Any] = []
     
     var addButtonLayer: CALayer?
+    
+    var customStampWC: CustomStampWindowController!
 
     // MARK: Init Method
     
@@ -1099,7 +1101,7 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
     }
     
     @IBAction func customStampButtonAction(_ sender: NSButton) {
-        let customStampWC = CustomStampWindowController.currentWC()
+        customStampWC = CustomStampWindowController.init(windowNibName: "CustomStampWindowController")
         customStampWC.showWindow(nil)
         customStampWC.reloadData()
         customStampWC.clickHandle = {[weak self] windowVC, clickType, resultImage in
@@ -1130,10 +1132,12 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
             }
             self?.view.window?.endSheet(windowVC.window!)
             windowVC.clear()
+            CustomStampManager.manager.isWindowShow = false
         }
         self.view.window?.beginSheet(customStampWC.window!, completionHandler: { response in
             
         })
+        CustomStampManager.manager.isWindowShow = true
     }
     
     

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

@@ -1746,6 +1746,9 @@ import Cocoa
 //        KMPrint("已添加事件监听")
         self.eventMonitor = NSEvent.addLocalMonitorForEvents(matching: [.scrollWheel, .leftMouseDown]) { [weak self] event in
             if (event.type == .scrollWheel && event.modifierFlags.contains(.option)) { // Alt + 鼠标滚轮
+                if CustomStampManager.manager.isWindowShow {
+                    return event
+                }
                 self?.listView.magnifyWheel(event)
                 return nil
             } else if event.type == .leftMouseDown {

+ 1 - 1
PDF Office/PDF Master/Strings/it.lproj/Localizable.strings

@@ -2750,7 +2750,7 @@
 "Identity"="identità";
 "Your identifying information will be used for annotations, comments, and digital signatures. The information will only be used for this program and will not be transmitted outside without your permission."="La tua identità verrà utilizzata per annotazioni, commenti annotati e firme digitali. Le informazioni che inserisci qui vengono utilizzate solo da questo programma e non verranno trasferite all'esterno di questo programma senza la tua autorizzazione.";
 "From Image"="dall'immagine";
-"White Redact"="Dipingi di bianco";
+"White Redact"="Dipingi di bianco"; 
 "Auto-create the folder with the same name"="Crea automaticamente una cartella con lo stesso nome";
 "Apply to multiple pages"="Applica a più pagine";
 "Add Link"="Aggiungi un collegamento";

+ 1 - 1
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -1178,7 +1178,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "654"
             endingLineNumber = "654"
-            landmarkName = "timerTick()"
+            landmarkName = "openPDFAction(_:)"
             landmarkType = "7">
             <Locations>
                <Location