Browse Source

【UI替换】主页 - 拖拽文件开启文件

lizhe 1 year ago
parent
commit
e93b79fe89

+ 4 - 0
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -430,6 +430,10 @@ extension KMHomeViewController {
             let savePath = fetchUniquePath(fileName.kUrlToPDFFolderPath() as String)
             openOfficeFile(url: path)
         }
+        
+        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
+            self.homeContentView.historyListView.reloadData()
+        }
     }
     
     func openImageFile(url: URL) -> Void {

+ 33 - 33
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.xib

@@ -51,39 +51,6 @@
             <rect key="frame" x="0.0" y="0.0" width="1074" height="820"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="3Ej-3j-QZ3" customClass="KMHomeDragView" customModule="PDF_Master" customModuleProvider="target">
-                    <rect key="frame" x="16" y="16" width="1042" height="788"/>
-                    <subviews>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="lTX-FO-7Ze">
-                            <rect key="frame" x="489" y="374" width="65" height="40"/>
-                            <subviews>
-                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hn2-R8-Bfv">
-                                    <rect key="frame" x="14" y="12" width="37" height="16"/>
-                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="gkz-Hj-UOJ">
-                                        <font key="font" metaFont="system"/>
-                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                    </textFieldCell>
-                                </textField>
-                            </subviews>
-                            <constraints>
-                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="centerY" secondItem="lTX-FO-7Ze" secondAttribute="centerY" id="0mX-xj-ymp"/>
-                                <constraint firstAttribute="trailing" secondItem="Hn2-R8-Bfv" secondAttribute="trailing" constant="16" id="8ZE-Sq-o1b"/>
-                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="leading" secondItem="lTX-FO-7Ze" secondAttribute="leading" constant="16" id="VWe-FK-0wL"/>
-                                <constraint firstAttribute="height" constant="40" id="tbq-SH-11p"/>
-                            </constraints>
-                        </customView>
-                    </subviews>
-                    <constraints>
-                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerY" secondItem="3Ej-3j-QZ3" secondAttribute="centerY" id="VsN-Nk-XSF"/>
-                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerX" secondItem="3Ej-3j-QZ3" secondAttribute="centerX" id="Z88-ci-g4b"/>
-                    </constraints>
-                    <connections>
-                        <outlet property="dragLabel" destination="Hn2-R8-Bfv" id="Bcu-KC-jTb"/>
-                        <outlet property="dragView" destination="lTX-FO-7Ze" id="l8P-gG-51q"/>
-                        <outlet property="dragViewHeight" destination="tbq-SH-11p" id="rKn-sf-EOE"/>
-                    </connections>
-                </customView>
                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1v2-87-qa4">
                     <rect key="frame" x="537" y="410" width="0.0" height="0.0"/>
                     <buttonCell key="cell" type="square" title="Button" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="Qq0-z1-7iI">
@@ -415,6 +382,39 @@ Gw
                         <outlet property="delegate" destination="-2" id="Nyn-SM-8if"/>
                     </connections>
                 </splitView>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="3Ej-3j-QZ3" customClass="KMHomeDragView" customModule="PDF_Master" customModuleProvider="target">
+                    <rect key="frame" x="16" y="16" width="1042" height="788"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="lTX-FO-7Ze">
+                            <rect key="frame" x="489" y="374" width="65" height="40"/>
+                            <subviews>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hn2-R8-Bfv">
+                                    <rect key="frame" x="14" y="12" width="37" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="gkz-Hj-UOJ">
+                                        <font key="font" metaFont="system"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="centerY" secondItem="lTX-FO-7Ze" secondAttribute="centerY" id="0mX-xj-ymp"/>
+                                <constraint firstAttribute="trailing" secondItem="Hn2-R8-Bfv" secondAttribute="trailing" constant="16" id="8ZE-Sq-o1b"/>
+                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="leading" secondItem="lTX-FO-7Ze" secondAttribute="leading" constant="16" id="VWe-FK-0wL"/>
+                                <constraint firstAttribute="height" constant="40" id="tbq-SH-11p"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerY" secondItem="3Ej-3j-QZ3" secondAttribute="centerY" id="VsN-Nk-XSF"/>
+                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerX" secondItem="3Ej-3j-QZ3" secondAttribute="centerX" id="Z88-ci-g4b"/>
+                    </constraints>
+                    <connections>
+                        <outlet property="dragLabel" destination="Hn2-R8-Bfv" id="Bcu-KC-jTb"/>
+                        <outlet property="dragView" destination="lTX-FO-7Ze" id="l8P-gG-51q"/>
+                        <outlet property="dragViewHeight" destination="tbq-SH-11p" id="rKn-sf-EOE"/>
+                    </connections>
+                </customView>
             </subviews>
             <constraints>
                 <constraint firstItem="3Ej-3j-QZ3" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="DZ1-ex-OuL"/>