Browse Source

【批量处理】转档-拖拽文件到框选中心,添加无效

liujiajie 10 months ago
parent
commit
4795b4e3ab

+ 7 - 0
PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateLeftViewController.swift

@@ -107,6 +107,8 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
         self.blankView.wantsLayer = true
         self.blankView.layer?.backgroundColor = NSColor.clear.cgColor
         self.blankView.titleLabel.stringValue = NSLocalizedString("Select Files", comment: "")
+        self.blankView.imageView.isHidden = true
+        self.blankView.addButton.isHidden = false
         self.blankView.secondTitleLabel.stringValue = NSLocalizedString("Drop files here or Click Add Files at upper left corner. You can drag files to reorder as you need.", comment: "")
         self.blankView.mouseActionCallBack = { [weak self] mouseType in
             guard let self = self else { return }
@@ -327,6 +329,11 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
         
     }
     
+    
+    @IBAction func blankViewAddFileAction(_ sender: Any) {
+        self.chooseFile()
+    }
+    
     @IBAction func buttonClicked_DeleteFile(_ sender: Any) {
         let set = self.tableView.selectedRowIndexes
         let newArr: NSMutableArray = NSMutableArray.init(array: self.files)

+ 18 - 1
PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateLeftViewController.xib

@@ -265,6 +265,20 @@
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                     </textFieldCell>
                                 </textField>
+                                <button hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8eZ-ia-mtv">
+                                    <rect key="frame" x="68" y="50" width="140" height="140"/>
+                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="KMImageNameEmptyListNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="o8j-Uh-3Zt">
+                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                        <font key="font" metaFont="system"/>
+                                    </buttonCell>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="140" id="FAQ-AI-aUg"/>
+                                        <constraint firstAttribute="width" constant="140" id="GF5-QU-DL3"/>
+                                    </constraints>
+                                    <connections>
+                                        <action selector="blankViewAddFileAction:" target="-2" id="wjH-6m-Pc1"/>
+                                    </connections>
+                                </button>
                             </subviews>
                             <constraints>
                                 <constraint firstItem="tU6-rc-cEb" firstAttribute="top" secondItem="6Hf-rN-RVl" secondAttribute="bottom" constant="8" id="0lT-Bd-z3W"/>
@@ -275,7 +289,9 @@
                                 <constraint firstItem="tU6-rc-cEb" firstAttribute="centerX" secondItem="9GJ-Lf-bRA" secondAttribute="centerX" id="NWN-9j-uqf"/>
                                 <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="tU6-rc-cEb" secondAttribute="trailing" id="d8X-Ae-XwQ"/>
                                 <constraint firstAttribute="width" constant="275" id="mYh-dT-Msb"/>
+                                <constraint firstItem="8eZ-ia-mtv" firstAttribute="top" secondItem="aT2-4b-2xG" secondAttribute="top" id="toA-2V-wdv"/>
                                 <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6Hf-rN-RVl" secondAttribute="trailing" id="uRe-aH-NNZ"/>
+                                <constraint firstItem="8eZ-ia-mtv" firstAttribute="centerX" secondItem="9GJ-Lf-bRA" secondAttribute="centerX" id="xuT-ew-DiJ"/>
                                 <constraint firstItem="aT2-4b-2xG" firstAttribute="centerX" secondItem="9GJ-Lf-bRA" secondAttribute="centerX" id="yFN-Mz-HoM"/>
                             </constraints>
                         </customView>
@@ -285,6 +301,7 @@
                         <constraint firstItem="9GJ-Lf-bRA" firstAttribute="centerX" secondItem="G6v-if-4fr" secondAttribute="centerX" id="kJE-tO-m7r"/>
                     </constraints>
                     <connections>
+                        <outlet property="addButton" destination="8eZ-ia-mtv" id="ZcV-Ci-ZIe"/>
                         <outlet property="imageView" destination="aT2-4b-2xG" id="sQG-IE-mUv"/>
                         <outlet property="secondTitleLabel" destination="tU6-rc-cEb" id="X2z-T7-8wA"/>
                         <outlet property="titleLabel" destination="6Hf-rN-RVl" id="xFn-Ai-3qy"/>
@@ -304,7 +321,7 @@
                 <constraint firstAttribute="bottom" secondItem="G6v-if-4fr" secondAttribute="bottom" id="qqx-eK-gkx"/>
                 <constraint firstItem="yD5-qe-EWK" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="tcr-Fi-EVL"/>
             </constraints>
-            <point key="canvasLocation" x="-73" y="561.5"/>
+            <point key="canvasLocation" x="-73.5" y="561.5"/>
         </customView>
         <menu id="e6T-xh-hi0">
             <items>

+ 1 - 0
PDF Office/PDF Master/Class/PDFTools/Merge/OCPart/KMBlankView.swift

@@ -23,6 +23,7 @@ class KMBlankView: NSView {
     @IBOutlet var titleLabel: NSTextField!
     @IBOutlet var secondTitleLabel: NSTextField!
     @IBOutlet var imageView: NSImageView!
+    @IBOutlet var addButton: NSButton!
     @IBOutlet var customView: KMPDFEditAppendCustomView!
 
     var allowedFileTypes: [String] = ["pdf"]