Browse Source

【UI替换】编辑工具 - 合并UI优化

lizhe 1 year ago
parent
commit
7eea678457

+ 11 - 3
PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/View/KMMergeView.swift

@@ -46,8 +46,16 @@ class KMMergeView: KMBaseXibView {
     
     
     let MyTableCellViewDataType = NSPasteboard.PasteboardType(rawValue: "KMLocalForDraggedTypes")
-    var files: [KMFileAttribute] = [] //导入文件
-    var lockFiles: [KMFileAttribute] = [] //存在密码文件
+    var files: [KMFileAttribute] = [] {
+        didSet {
+            self.reloadData()
+        }
+    }
+    var lockFiles: [KMFileAttribute] = [] {
+        didSet {
+            self.reloadData()
+        }
+    }//存在密码文件
     var lockFilesIndex: Int = 0
     var newPageSize = CGSizeZero
     
@@ -98,7 +106,7 @@ class KMMergeView: KMBaseXibView {
         cancelButton.title = NSLocalizedString("Cancel",  comment: "");
         clearButton.title = NSLocalizedString("Clear",  comment: "");
         addFilesButton.title = NSLocalizedString("Add Files",  comment: "")
-        mergeButton.title = NSLocalizedString("Merge",  comment: "")
+        mergeButton.title = NSLocalizedString("Append",  comment: "")
         
         boxLabel.stringValue = NSLocalizedString("Page size:", comment: "")
     }

+ 4 - 4
PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/View/KMMergeView.xib

@@ -42,20 +42,20 @@
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="etf-2M-YwD">
                             <rect key="frame" x="40" y="60" width="480" height="489"/>
                             <subviews>
-                                <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="60" horizontalPageScroll="10" verticalLineScroll="60" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EWX-cc-X5u">
+                                <scrollView autohidesScrollers="YES" horizontalLineScroll="60" horizontalPageScroll="10" verticalLineScroll="60" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EWX-cc-X5u">
                                     <rect key="frame" x="0.0" y="0.0" width="480" height="489"/>
                                     <clipView key="contentView" drawsBackground="NO" id="Kx1-Yj-S3W">
-                                        <rect key="frame" x="0.0" y="0.0" width="480" height="489"/>
+                                        <rect key="frame" x="1" y="1" width="478" height="487"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="60" translatesAutoresizingMaskIntoConstraints="NO" id="hSd-xd-6WS">
-                                                <rect key="frame" x="0.0" y="0.0" width="480" height="489"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="478" height="487"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <size key="intercellSpacing" width="17" height="0.0"/>
                                                 <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                                 <color key="gridColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                                 <tableColumns>
-                                                    <tableColumn width="448" minWidth="10" maxWidth="3.4028234663852886e+38" id="pXw-Iw-CqQ">
+                                                    <tableColumn width="466" minWidth="10" maxWidth="3.4028234663852886e+38" id="pXw-Iw-CqQ">
                                                         <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
                                                             <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

+ 1 - 0
PDF Office/PDF Master/Class/PDFTools/Merge/Model/KMFileAttribute.swift

@@ -38,6 +38,7 @@ import Cocoa
             
             let document = CPDFDocument.init(url: URL(string: filePath))
             isLocked = document!.isLocked
+            self.pdfDocument = document
             
             fileImage = NSImage.previewForFile(path: URL(fileURLWithPath: filePath), ofSize: CGSizeMake(136, 214), asIcon: true) ?? NSImage()
         }