Bläddra i källkod

[综合] - 图片转PDF UI右侧对齐、自定义裁剪优化

liujiajie 11 månader sedan
förälder
incheckning
5a1b6dcc17

+ 9 - 9
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateImageToPDFViewController.xib

@@ -134,7 +134,7 @@
                     </buttonCell>
                 </button>
                 <button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gJA-ad-BvI">
-                    <rect key="frame" x="212" y="97" width="26" height="26"/>
+                    <rect key="frame" x="440" y="97" width="26" height="26"/>
                     <buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Ik9-0w-YNF">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                         <font key="font" metaFont="system"/>
@@ -148,13 +148,13 @@
                     </connections>
                 </button>
                 <box boxType="custom" cornerRadius="1" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="0xe-05-6j8">
-                    <rect key="frame" x="34" y="99" width="176" height="24"/>
+                    <rect key="frame" x="34" y="99" width="404" height="24"/>
                     <view key="contentView" id="Sfo-EK-dRW">
-                        <rect key="frame" x="1" y="1" width="174" height="22"/>
+                        <rect key="frame" x="1" y="1" width="402" height="22"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Que-YG-sCE">
-                                <rect key="frame" x="0.0" y="-2" width="170" height="24"/>
+                                <rect key="frame" x="0.0" y="-2" width="398" height="24"/>
                                 <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="NSDescendingSortIndicator" imagePosition="right" alignment="left" imageScaling="proportionallyDown" inset="2" id="RHP-PZ-KGD">
                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                     <font key="font" metaFont="system"/>
@@ -175,7 +175,6 @@
                     </view>
                     <constraints>
                         <constraint firstAttribute="height" constant="24" id="W4o-2n-HHz"/>
-                        <constraint firstAttribute="width" constant="176" id="bbE-xq-Vz0"/>
                     </constraints>
                 </box>
                 <button translatesAutoresizingMaskIntoConstraints="NO" id="DvB-9f-Xgt">
@@ -189,13 +188,13 @@
                     </connections>
                 </button>
                 <box boxType="custom" cornerRadius="1" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="xu7-RV-DKR">
-                    <rect key="frame" x="34" y="163" width="204" height="24"/>
+                    <rect key="frame" x="34" y="163" width="430" height="24"/>
                     <view key="contentView" id="U53-s6-6nW">
-                        <rect key="frame" x="1" y="1" width="202" height="22"/>
+                        <rect key="frame" x="1" y="1" width="428" height="22"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9go-Ka-u3z">
-                                <rect key="frame" x="0.0" y="-2" width="198" height="24"/>
+                                <rect key="frame" x="0.0" y="-2" width="424" height="24"/>
                                 <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="NSDescendingSortIndicator" imagePosition="right" alignment="left" imageScaling="proportionallyDown" inset="2" id="2zY-MC-UG7">
                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                     <font key="font" metaFont="system"/>
@@ -216,7 +215,6 @@
                     </view>
                     <constraints>
                         <constraint firstAttribute="height" constant="24" id="GZN-BA-UHl"/>
-                        <constraint firstAttribute="width" constant="204" id="eca-sg-oYC"/>
                     </constraints>
                 </box>
                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="LnK-B0-rGp">
@@ -245,6 +243,7 @@
                 <constraint firstItem="gJA-ad-BvI" firstAttribute="centerY" secondItem="0xe-05-6j8" secondAttribute="centerY" id="b5C-zZ-uoa"/>
                 <constraint firstItem="aPB-Pb-64w" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="cm2-wz-AP3"/>
                 <constraint firstAttribute="trailing" secondItem="k0c-vv-NPP" secondAttribute="trailing" constant="16" id="dEN-Bs-9oC"/>
+                <constraint firstItem="xu7-RV-DKR" firstAttribute="trailing" secondItem="k0c-vv-NPP" secondAttribute="trailing" id="ePZ-m2-erM"/>
                 <constraint firstItem="mXd-Rx-c3O" firstAttribute="top" secondItem="0xe-05-6j8" secondAttribute="bottom" constant="11" id="evq-KN-Xwq"/>
                 <constraint firstItem="xu7-RV-DKR" firstAttribute="leading" secondItem="Sf1-WE-VzB" secondAttribute="leading" id="fyS-0U-CJM"/>
                 <constraint firstItem="LnK-B0-rGp" firstAttribute="top" secondItem="xu7-RV-DKR" secondAttribute="bottom" constant="16" id="g6b-iG-T0X"/>
@@ -253,6 +252,7 @@
                 <constraint firstItem="lwQ-xY-nsX" firstAttribute="leading" secondItem="aPB-Pb-64w" secondAttribute="leading" id="kVr-oh-CY2"/>
                 <constraint firstItem="DvB-9f-Xgt" firstAttribute="top" secondItem="hyp-2H-elp" secondAttribute="bottom" constant="18" id="kxm-lu-bCL"/>
                 <constraint firstItem="hyp-2H-elp" firstAttribute="leading" secondItem="aPB-Pb-64w" secondAttribute="leading" id="mdU-8E-lPS"/>
+                <constraint firstItem="gJA-ad-BvI" firstAttribute="trailing" secondItem="k0c-vv-NPP" secondAttribute="trailing" id="nTH-mg-Z0g"/>
                 <constraint firstItem="hyp-2H-elp" firstAttribute="top" secondItem="k0c-vv-NPP" secondAttribute="bottom" constant="32" id="qP4-2t-rG9"/>
                 <constraint firstItem="mXd-Rx-c3O" firstAttribute="leading" secondItem="0xe-05-6j8" secondAttribute="leading" id="rJ4-0r-4NH"/>
                 <constraint firstItem="HkY-4k-ShL" firstAttribute="top" relation="greaterThanOrEqual" secondItem="mXd-Rx-c3O" secondAttribute="bottom" constant="20" id="rqm-ei-Qo0"/>

+ 4 - 2
PDF Office/PDF Master/Class/PDFTools/Crop/KMPDFCropWindowController.swift

@@ -82,6 +82,8 @@ class KMPDFCropWindowController: NSWindowController, CPDFViewDelegate, NSWindowD
     @IBOutlet var pdfView: KMCropPDFView!
     @IBOutlet var cropLabel: NSTextField!
     
+    var fileAttribute: KMFileAttribute!
+    
     var isChangePageSize = false
     var cropWindowCloseBlock: cropWindowCloseBlock?
     
@@ -118,7 +120,7 @@ class KMPDFCropWindowController: NSWindowController, CPDFViewDelegate, NSWindowD
     override func windowDidLoad() {
         super.windowDidLoad()
         self.cropRect = self.defaultCropRect
-        
+        fileAttribute = KMFileAttribute()
         self.pdfView.wantsLayer = true
         self.pdfView.layer?.borderColor = NSColor.black.cgColor
         self.pdfView.layer?.borderWidth = 2
@@ -265,7 +267,7 @@ class KMPDFCropWindowController: NSWindowController, CPDFViewDelegate, NSWindowD
                 }
             }
         } else {
-            let fileAttribute = KMFileAttribute()
+//            let fileAttribute = KMFileAttribute()
             fileAttribute.filePath = self.originalDocument?.documentURL.path ?? ""
             fileAttribute.bAllPage = false
             fileAttribute.pagesString = self.pageRangeComboBox.stringValue

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/Tools/FMTrackEventManager.swift

@@ -22,7 +22,9 @@ import AppCenterAnalytics
     func trackEvent(event: String, withProperties properties: [String: String]?) {
         if event.count < 1 { return }
 #if DEBUG
-        NSLog("###-FireBaseEvent-(event)-(properties?.first?.key)-(properties?.first?.value)")
+        let keyStr: String = properties?.keys.first ?? ""
+        let vStr: String = properties?.values.first ?? ""
+        NSLog("###-FireBaseEvent-(%@)-properties(%@):(%@)",event,keyStr,vStr)
 #endif
         // if RIAnalytics.isNewUserForCurrentVersion()
         if let props = properties {