Bladeren bron

UI - 首页历史文件【删除】弹窗高保真、交互效果调整

wanjun 2 jaren geleden
bovenliggende
commit
be4291c8d4

+ 1 - 1
PDF Office/PDF Office/Class/Home/ViewController/KMHomeHistoryFileViewController.swift

@@ -483,7 +483,7 @@ class KMHomeHistoryFileViewController: NSViewController, NSCollectionViewDelegat
         if selectFiles.count == 0 {
             for url in NSDocumentController.shared.recentDocumentURLs {
                 if FileManager.default.fileExists(atPath: url.path) {
-//                            selectFiles.append(url)
+                    selectFiles.append(url)
                 }
             }
             self.delete?.historyFileViewController!(self, deleteDocuments: selectFiles)

+ 16 - 16
PDF Office/PDF Office/Class/Home/WindowController/KMHistoryFileDeleteWindowController.swift

@@ -12,6 +12,7 @@ typealias historyFileDeleteCallback = (_ indexPaths: [URL], _ windowController:
 class KMHistoryFileDeleteWindowController: NSWindowController {
 
     @IBOutlet weak var deleteOptionsLabel: NSTextField!
+    @IBOutlet weak var subLabel: NSTextField!
     @IBOutlet weak var noLongerPromptButton: NSButton!
     @IBOutlet weak var cancelBox: KMBox!
     @IBOutlet weak var cancelLabel: NSTextField!
@@ -26,18 +27,14 @@ class KMHistoryFileDeleteWindowController: NSWindowController {
 
         initializeUI()
         initLocalization()
-        cancelBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox) -> Void in
+        cancelBox.downCallback = { [self](downEntered: Bool, mouseBox: KMBox) -> Void in
             if downEntered {
-                if self != nil {
-                    self!.cancelAction()
-                }
+                self.cancelAction()
             }
         }
-        deleteBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox) -> Void in
+        deleteBox.downCallback = { [self](downEntered: Bool, mouseBox: KMBox) -> Void in
             if downEntered {
-                if self != nil {
-                    self!.deleteAction()
-                }
+                self.deleteAction()
             }
         }
     }
@@ -48,21 +45,24 @@ class KMHistoryFileDeleteWindowController: NSWindowController {
         self.window?.backgroundColor = .white
         deleteOptionsLabel.font = NSFont(name: "PingFangSC-Semibold", size: 15)
         deleteOptionsLabel.textColor = .black
-        deleteLabel.font = NSFont(name: "PingFangSC-Regular", size: 17)
+        deleteLabel.font = NSFont.SFProTextRegular(13)
         deleteLabel.textColor = .white
-        deleteBox.fillColor = .black
+        deleteBox.fillColor = NSColor(hex: "#367AF6")
         deleteBox.cornerRadius = 4
-        cancelLabel.font = NSFont(name: "PingFangSC-Regular", size: 17)
+        cancelLabel.font = NSFont.SFProTextRegular(13)
         cancelLabel.textColor = .black
-        cancelBox.fillColor = .white
+        cancelBox.fillColor = NSColor(hex: "#F5F5F5")
         cancelBox.cornerRadius = 4
+        subLabel.font = NSFont.SFProTextRegular(11)
+        subLabel.textColor = NSColor(hex: "#4D4D4D")
     }
     
     func initLocalization() {
-        deleteOptionsLabel.stringValue = NSLocalizedString("从“最近”列表中删除已选项目", comment: "")
-        noLongerPromptButton.title = NSLocalizedString("不再提示", comment: "")
-        cancelLabel.stringValue = NSLocalizedString("取消", comment: "")
-        deleteLabel.stringValue = NSLocalizedString("删除", comment: "")
+        deleteOptionsLabel.stringValue = NSLocalizedString("Remove“PDF Office Quick Guide.pdf”from your Recent Files?", comment: "")
+        noLongerPromptButton.title = NSLocalizedString("Don't ask again", comment: "")
+        cancelLabel.stringValue = NSLocalizedString("Cancel", comment: "")
+        deleteLabel.stringValue = NSLocalizedString("Delete", comment: "")
+        subLabel.stringValue = NSLocalizedString("The file will disappear from the recent list.", comment: "")
     }
     
     // MARK: Private Methods

+ 63 - 34
PDF Office/PDF Office/Class/Home/WindowController/KMHistoryFileDeleteWindowController.xib

@@ -13,7 +13,8 @@
                 <outlet property="deleteBox" destination="ICh-pS-7xc" id="e6j-Jk-V9z"/>
                 <outlet property="deleteLabel" destination="2LV-pz-0qV" id="G6e-c3-eVa"/>
                 <outlet property="deleteOptionsLabel" destination="pp4-jZ-PBy" id="RfJ-0m-IH8"/>
-                <outlet property="noLongerPromptButton" destination="erm-U2-pvu" id="B9n-hd-71W"/>
+                <outlet property="noLongerPromptButton" destination="kjv-SI-5Gb" id="9LV-iq-kZl"/>
+                <outlet property="subLabel" destination="PPk-8P-cQr" id="pSD-b4-Pef"/>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
             </connections>
         </customObject>
@@ -21,37 +22,37 @@
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="240" width="295" height="207"/>
+            <rect key="contentRect" x="196" y="240" width="253" height="260"/>
             <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
-            <view key="contentView" id="se5-gp-TjO">
-                <rect key="frame" x="0.0" y="0.0" width="295" height="207"/>
+            <view key="contentView" misplaced="YES" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="260" height="251"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pp4-jZ-PBy">
-                        <rect key="frame" x="28" y="139" width="239" height="25"/>
+                        <rect key="frame" x="14" y="119" width="232" height="16"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="25" id="dnx-gG-lOd"/>
+                            <constraint firstAttribute="width" constant="228" id="SGg-Fg-WbD"/>
                         </constraints>
-                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="I5C-zs-Vdr">
+                        <textFieldCell key="cell" title="Label" id="I5C-zs-Vdr">
                             <font key="font" usesAppearanceFont="YES"/>
                             <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                         </textFieldCell>
                     </textField>
                     <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="CFg-PY-DoN">
-                        <rect key="frame" x="37" y="29" width="222" height="40"/>
+                        <rect key="frame" x="16" y="49" width="228" height="28"/>
                         <view key="contentView" id="foZ-sP-lIV">
-                            <rect key="frame" x="0.0" y="0.0" width="222" height="40"/>
+                            <rect key="frame" x="0.0" y="0.0" width="228" height="28"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
-                                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="84N-oJ-zPU" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
-                                    <rect key="frame" x="0.0" y="0.0" width="87" height="40"/>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="84N-oJ-zPU" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
+                                    <rect key="frame" x="0.0" y="0.0" width="110" height="28"/>
                                     <view key="contentView" id="eeh-vE-MkA">
-                                        <rect key="frame" x="1" y="1" width="85" height="38"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="110" height="28"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cqe-Aa-Ii8">
-                                                <rect key="frame" x="24" y="11" width="37" height="16"/>
+                                                <rect key="frame" x="37" y="6" width="37" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="DaB-3l-ib1">
                                                     <font key="font" usesAppearanceFont="YES"/>
                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -60,22 +61,23 @@
                                             </textField>
                                         </subviews>
                                         <constraints>
-                                            <constraint firstItem="cqe-Aa-Ii8" firstAttribute="leading" secondItem="eeh-vE-MkA" secondAttribute="leading" constant="26" id="1u5-ol-UzX"/>
-                                            <constraint firstAttribute="trailing" secondItem="cqe-Aa-Ii8" secondAttribute="trailing" constant="26" id="xPx-kd-5pB"/>
+                                            <constraint firstItem="cqe-Aa-Ii8" firstAttribute="centerX" secondItem="eeh-vE-MkA" secondAttribute="centerX" id="BtL-N3-xu7"/>
                                         </constraints>
                                     </view>
                                     <constraints>
+                                        <constraint firstAttribute="width" constant="110" id="Gay-3n-o4g"/>
                                         <constraint firstItem="cqe-Aa-Ii8" firstAttribute="centerY" secondItem="84N-oJ-zPU" secondAttribute="centerY" id="kki-zj-ErA"/>
+                                        <constraint firstItem="cqe-Aa-Ii8" firstAttribute="centerY" secondItem="84N-oJ-zPU" secondAttribute="centerY" id="qu2-4r-Vh0"/>
                                     </constraints>
                                 </box>
-                                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ICh-pS-7xc" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
-                                    <rect key="frame" x="135" y="0.0" width="87" height="40"/>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ICh-pS-7xc" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
+                                    <rect key="frame" x="118" y="0.0" width="110" height="28"/>
                                     <view key="contentView" id="JRM-SG-WrT">
-                                        <rect key="frame" x="1" y="1" width="85" height="38"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="110" height="28"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2LV-pz-0qV">
-                                                <rect key="frame" x="24" y="11" width="37" height="16"/>
+                                                <rect key="frame" x="37" y="6" width="37" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="nAe-KE-x3t">
                                                     <font key="font" usesAppearanceFont="YES"/>
                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -84,12 +86,11 @@
                                             </textField>
                                         </subviews>
                                         <constraints>
-                                            <constraint firstItem="2LV-pz-0qV" firstAttribute="leading" secondItem="JRM-SG-WrT" secondAttribute="leading" constant="26" id="3kf-Zg-HjW"/>
-                                            <constraint firstAttribute="trailing" secondItem="2LV-pz-0qV" secondAttribute="trailing" constant="26" id="pTw-qd-9mn"/>
+                                            <constraint firstItem="2LV-pz-0qV" firstAttribute="centerX" secondItem="JRM-SG-WrT" secondAttribute="centerX" id="iWZ-3C-oEk"/>
                                         </constraints>
                                     </view>
                                     <constraints>
-                                        <constraint firstAttribute="height" constant="40" id="chL-3u-a9G"/>
+                                        <constraint firstAttribute="height" constant="28" id="chL-3u-a9G"/>
                                         <constraint firstItem="2LV-pz-0qV" firstAttribute="centerY" secondItem="ICh-pS-7xc" secondAttribute="centerY" id="zAt-XT-pze"/>
                                     </constraints>
                                 </box>
@@ -99,39 +100,67 @@
                                 <constraint firstAttribute="trailing" secondItem="ICh-pS-7xc" secondAttribute="trailing" id="72r-Db-fyb"/>
                                 <constraint firstAttribute="bottom" secondItem="84N-oJ-zPU" secondAttribute="bottom" id="BYG-N7-9BJ"/>
                                 <constraint firstItem="ICh-pS-7xc" firstAttribute="top" secondItem="foZ-sP-lIV" secondAttribute="top" id="CBN-k0-edY"/>
-                                <constraint firstItem="ICh-pS-7xc" firstAttribute="leading" secondItem="84N-oJ-zPU" secondAttribute="trailing" constant="48" id="FVA-rZ-aTp"/>
                                 <constraint firstItem="84N-oJ-zPU" firstAttribute="leading" secondItem="foZ-sP-lIV" secondAttribute="leading" id="P9b-rj-cw8"/>
                                 <constraint firstItem="ICh-pS-7xc" firstAttribute="height" secondItem="84N-oJ-zPU" secondAttribute="height" id="URO-no-nNv"/>
                                 <constraint firstItem="ICh-pS-7xc" firstAttribute="width" secondItem="84N-oJ-zPU" secondAttribute="width" id="sXl-EI-Kwi"/>
                                 <constraint firstItem="84N-oJ-zPU" firstAttribute="top" secondItem="foZ-sP-lIV" secondAttribute="top" id="vrj-We-jth"/>
+                                <constraint firstItem="ICh-pS-7xc" firstAttribute="leading" secondItem="84N-oJ-zPU" secondAttribute="trailing" constant="8" id="zW3-Pr-URN"/>
                             </constraints>
                         </view>
                     </box>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="erm-U2-pvu">
-                        <rect key="frame" x="28" y="96" width="67" height="18"/>
-                        <buttonCell key="cell" type="check" title="Button" bezelStyle="regularSquare" imagePosition="left" inset="2" id="uk2-jr-ejf">
+                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="fLO-Nh-mth">
+                        <rect key="frame" x="98" y="155" width="64" height="64"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="64" id="2Bl-A7-mw4"/>
+                            <constraint firstAttribute="height" constant="64" id="Xct-nV-zdw"/>
+                        </constraints>
+                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="Biochemistry" id="ohe-3M-dgU"/>
+                    </imageView>
+                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kjv-SI-5Gb">
+                        <rect key="frame" x="96" y="16" width="67" height="18"/>
+                        <buttonCell key="cell" type="check" title="Button" bezelStyle="regularSquare" imagePosition="left" inset="2" id="9aL-NV-7Bc">
                             <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                             <font key="font" metaFont="system"/>
                         </buttonCell>
                         <connections>
-                            <action selector="deleteHistoryFileAction:" target="-2" id="qi3-Y3-gKb"/>
+                            <action selector="deleteHistoryFileAction:" target="-2" id="APC-nJ-mOD"/>
                         </connections>
                     </button>
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="PPk-8P-cQr">
+                        <rect key="frame" x="18" y="93" width="224" height="16"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="220" id="N9h-iB-cIj"/>
+                        </constraints>
+                        <textFieldCell key="cell" title="Label" id="qVV-eM-A5K">
+                            <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="CFg-PY-DoN" firstAttribute="top" secondItem="erm-U2-pvu" secondAttribute="bottom" constant="28" id="7QP-wp-qYu"/>
-                    <constraint firstItem="pp4-jZ-PBy" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="30" id="9vb-ag-1j8"/>
-                    <constraint firstItem="pp4-jZ-PBy" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="43" id="Dl2-LW-c6A"/>
-                    <constraint firstItem="erm-U2-pvu" firstAttribute="top" secondItem="pp4-jZ-PBy" secondAttribute="bottom" constant="26" id="Q2s-lO-fdm"/>
+                    <constraint firstItem="fLO-Nh-mth" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="8IX-Gy-4K0"/>
+                    <constraint firstItem="pp4-jZ-PBy" firstAttribute="top" secondItem="fLO-Nh-mth" secondAttribute="bottom" constant="20" id="CPs-py-CU6"/>
+                    <constraint firstItem="kjv-SI-5Gb" firstAttribute="top" secondItem="CFg-PY-DoN" secondAttribute="bottom" constant="16" id="Dbb-6a-1HS"/>
+                    <constraint firstItem="fLO-Nh-mth" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="20" id="FQ3-KB-oBb"/>
+                    <constraint firstItem="CFg-PY-DoN" firstAttribute="top" secondItem="PPk-8P-cQr" secondAttribute="bottom" constant="16" id="KX6-pO-jYG"/>
+                    <constraint firstItem="PPk-8P-cQr" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="Kv7-PV-N2Z"/>
+                    <constraint firstItem="pp4-jZ-PBy" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="MX1-qU-bth"/>
                     <constraint firstItem="CFg-PY-DoN" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="Qi0-oW-N6N"/>
-                    <constraint firstAttribute="trailing" secondItem="pp4-jZ-PBy" secondAttribute="trailing" constant="30" id="blM-Pe-iPz"/>
-                    <constraint firstItem="erm-U2-pvu" firstAttribute="leading" secondItem="pp4-jZ-PBy" secondAttribute="leading" id="o29-Oj-bac"/>
+                    <constraint firstAttribute="bottom" secondItem="kjv-SI-5Gb" secondAttribute="bottom" constant="17" id="YdS-DD-Or4"/>
+                    <constraint firstAttribute="trailing" secondItem="CFg-PY-DoN" secondAttribute="trailing" constant="16" id="ahQ-x5-G37"/>
+                    <constraint firstItem="CFg-PY-DoN" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="16" id="kNt-7z-8vF"/>
+                    <constraint firstItem="kjv-SI-5Gb" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="rXh-RR-fvg"/>
+                    <constraint firstItem="PPk-8P-cQr" firstAttribute="top" secondItem="pp4-jZ-PBy" secondAttribute="bottom" constant="10" id="uft-d7-OyI"/>
                 </constraints>
             </view>
             <connections>
                 <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
             </connections>
-            <point key="canvasLocation" x="139" y="143.5"/>
+            <point key="canvasLocation" x="138.5" y="188.5"/>
         </window>
     </objects>
+    <resources>
+        <image name="Biochemistry" width="612" height="783"/>
+    </resources>
 </document>