Просмотр исходного кода

综合-菜单栏帮助菜单新增交互

tangchao 2 лет назад
Родитель
Сommit
a424defe1e

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


+ 4 - 4
PDF Office/PDF Office/AppDelegate.swift

@@ -247,15 +247,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
     }
     
     @IBAction func menuItemAction_onlineHelp(_ sender: NSMenuItem) -> Void {
-        
+        KMTools.openFAQWebsite()
     }
     
     @IBAction func menuItemAction_morePudact(_ sender: NSMenuItem) -> Void {
-        
+        KMTools.openMoreProductWebsite()
     }
     
     @IBAction func menuItemAction_freePDFTemplate(_ sender: NSMenuItem) -> Void {
-        
+        KMTools.openFreePDFTemplatesWebsite()
     }
     
     @IBAction func menuItemAction_payEmail(_ sender: NSMenuItem) -> Void {
@@ -263,7 +263,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
     }
     
     @IBAction func menuItemAction_poweredByComPDFKit(_ sender: NSMenuItem) -> Void {
-        
+        KMTools.openComPDFKitPowerWebsite()
     }
     
     @IBAction func menuItemAction_feekback(_ sender: NSMenuItem) -> Void {

+ 21 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameCloseProgress12.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "icon_close.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 79 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameCloseProgress12.imageset/icon_close.pdf

@@ -0,0 +1,79 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.469727 1.469727 cm
+0.580392 0.596078 0.611765 scn
+4.530330 3.469556 m
+8.000000 -0.000113 l
+9.060660 1.060547 l
+5.590991 4.530217 l
+9.060659 7.999887 l
+8.000000 9.060547 l
+4.530330 5.590877 l
+1.060660 9.060547 l
+0.000000 7.999887 l
+3.469670 4.530217 l
+0.000000 1.060546 l
+1.060661 -0.000114 l
+4.530330 3.469556 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  390
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 12.000000 12.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000480 00000 n
+0000000502 00000 n
+0000000675 00000 n
+0000000749 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+808
+%%EOF

+ 32 - 0
PDF Office/PDF Office/Class/Common/Tools/KMTools.swift

@@ -80,4 +80,36 @@ import Cocoa
         }
         return false
     }
+    
+    // MARK: -
+    // MARK: 打开网页
+    
+    @objc class func openURL(_ url: URL) {
+        NSWorkspace.shared.open(url)
+    }
+}
+
+// MARK: -
+// MARK: PDFOffice
+
+extension KMTools {
+    // 打开 [FAQ] 网站
+    @objc class func openFAQWebsite() {
+        KMTools.openURL(URL(string: "")!)
+    }
+    
+    // 打开 [更多产品] 网站
+    @objc class func openMoreProductWebsite() {
+        KMTools.openURL(URL(string: "https://www.pdfreaderpro.com/product?utm_source=MacApp&utm_campaign=ProductLink&utm_medium=PdfProduct")!)
+    }
+    
+    // 打开 [免费 PDF 模板] 网站
+    @objc class func openFreePDFTemplatesWebsite() {
+        KMTools.openURL(URL(string: "https://www.pdfreaderpro.com/templates?utm_source=MacApp&utm_campaign=TemplatesLink&utm_medium=PdfTemplates")!)
+    }
+    
+    // 打开 [ComPDFKit 授权] 网站
+    @objc class func openComPDFKitPowerWebsite() {
+        KMTools.openURL(URL(string: "https://www.compdf.com/?utm_source=macapp&utm_medium=pdfmac&utm_campaign=compdfkit-promp")!)
+    }
 }

+ 9 - 3
PDF Office/PDF Office/Class/PDFTools/Secure/View/KMSecureLimitAlertView.swift

@@ -15,6 +15,8 @@ class KMSecureLimitAlertView: NSView {
     var deleteButton = NSButton()
     var funcButton = NSButton()
     
+    var funcButtonVC: KMDesignButton?
+    
     var itemClick: KMSecureLimitAlertViewItemClick?
     private var funcButtonSize: NSSize = NSMakeSize(163, 32)
     
@@ -40,6 +42,10 @@ class KMSecureLimitAlertView: NSView {
         self.addSubview(self.deleteButton)
         self.addSubview(self.funcButton)
         
+        self.funcButtonVC = KMDesignButton(withType: .Text)
+        self.funcButton.addSubview(self.funcButtonVC!.view)
+        self.funcButtonVC?.view.frame = self.funcButton.bounds
+        self.funcButtonVC?.view.autoresizingMask = [.width, .height]
     
         self.wantsLayer = true
         layer?.backgroundColor = NSColor(hex: "#E8F5FF").cgColor
@@ -63,7 +69,7 @@ class KMSecureLimitAlertView: NSView {
         ])
         
         self.deleteButton.isBordered = false
-        self.deleteButton.image = NSImage(named: "KMImageNameWhiteClose")
+        self.deleteButton.image = NSImage(named: "KMImageNameCloseProgress12")
         self.deleteButton.target = self
         self.deleteButton.action = #selector(deleteButtonAction)
         
@@ -93,10 +99,10 @@ class KMSecureLimitAlertView: NSView {
         let height: CGFloat = NSHeight(self.bounds)
         
         let leftMargin: CGFloat = 16
-        self.titleLabel.frame = NSMakeRect(leftMargin, 12, width-leftMargin-60, 18)
+        self.titleLabel.frame = NSMakeRect(leftMargin, 16+4, width-leftMargin-60, 18)
         
         let despX: CGFloat = 16
-        let despY: CGFloat = self.titleLabel.frame.maxY+8
+        let despY: CGFloat = self.titleLabel.frame.maxY+8+4
         despLabel.frame = NSMakeRect(despX, despY, width-despX-36, height-despY-45)
         
         self.deleteButton.frame = NSMakeRect(width-34, 10, 24, 24)