Browse Source

【2025】【Page】分割UI问题

dinglingui 2 months ago
parent
commit
5a884eb739

+ 7 - 4
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFSplit/KMNSplitPDFWindowController.swift

@@ -36,6 +36,8 @@ class KMNSplitPDFWindowController: KMNBaseWindowController {
     
     @IBOutlet var cancelButton: ComponentButton!
     @IBOutlet var splitButton: ComponentButton!
+    
+    @IBOutlet var splitRangeHeightButton:NSLayoutConstraint!
 
     @IBOutlet var cancelWidthButton:NSLayoutConstraint!
     @IBOutlet var splitWidthButton:NSLayoutConstraint!
@@ -414,7 +416,7 @@ class KMNSplitPDFWindowController: KMNBaseWindowController {
                     fileAttribute.pagesType = .PagesString
                     fileAttribute.pagesString = splitRangeSelect.properties.text ?? ""
                 } else {
-                    if(pageRangeSelectIndex == 2) {
+                    if(pageRangeSelectIndex == 1) {
                         fileAttribute.pagesType = .OnlyEven
                     } else {
                         fileAttribute.pagesType = .PagesString
@@ -427,7 +429,8 @@ class KMNSplitPDFWindowController: KMNBaseWindowController {
                 
                 splitRangeSelect.properties.isError = true
                 splitRangeSelect.properties.errorText = KMLocalizedString("Invalid page range or the page number is out of range. Please try again.")
-                splitRangeSelect.reloadData()
+                splitRangeSelect.properties = splitRangeSelect.properties
+                splitRangeHeightButton.constant = splitRangeSelect.properties.propertyInfo.viewHeight
                 return
             }
         }
@@ -674,8 +677,8 @@ extension KMNSplitPDFWindowController: ComponentSelectDelegate {
     func componentSelectTextDidChange(_ view: ComponentSelect) {
         splitRangeSelect.properties.isError = false
         splitRangeSelect.properties.errorText = ""
-        splitRangeSelect.reloadData()
-
+        splitRangeSelect.properties = splitRangeSelect.properties
+        splitRangeHeightButton.constant = splitRangeSelect.properties.propertyInfo.viewHeight
     }
 
 }

+ 24 - 24
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFSplit/KMNSplitPDFWindowController.xib

@@ -28,6 +28,7 @@
                 <outlet property="separatorCheckWidthButton" destination="Abe-jb-3iL" id="ATb-a1-i7X"/>
                 <outlet property="separatorInput" destination="TZS-vp-GuO" id="mxR-rj-mIO"/>
                 <outlet property="splitButton" destination="lHU-2j-0SQ" id="EVK-mi-vLS"/>
+                <outlet property="splitRangeHeightButton" destination="t2F-JL-BWZ" id="kAq-bO-NCv"/>
                 <outlet property="splitRangeRadio" destination="OQ5-6X-OjQ" id="gXR-cC-nkK"/>
                 <outlet property="splitRangeRadioWidthButton" destination="b6x-Js-9ra" id="MVw-Mh-bel"/>
                 <outlet property="splitRangeSelect" destination="VNh-Qe-w42" id="wSP-pe-T3n"/>
@@ -43,21 +44,20 @@
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES" fullSizeContentView="YES"/>
-            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="240" width="480" height="270"/>
+            <rect key="contentRect" x="434" y="322" width="480" height="270"/>
             <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="480" height="494"/>
+            <view key="contentView" misplaced="YES" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="480" height="482"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="J6U-4A-QXu">
-                        <rect key="frame" x="24" y="16" width="432" height="462"/>
+                        <rect key="frame" x="24" y="16" width="432" height="454"/>
                         <view key="contentView" id="GOc-Px-FVN">
-                            <rect key="frame" x="0.0" y="0.0" width="432" height="462"/>
+                            <rect key="frame" x="0.0" y="0.0" width="432" height="454"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
                                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jDk-6k-wPg">
-                                    <rect key="frame" x="-2" y="446" width="436" height="16"/>
+                                    <rect key="frame" x="-2" y="438" width="436" height="16"/>
                                     <textFieldCell key="cell" lineBreakMode="clipping" title="Split" id="cYm-fs-fJs">
                                         <font key="font" usesAppearanceFont="YES"/>
                                         <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -65,27 +65,27 @@
                                     </textFieldCell>
                                 </textField>
                                 <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Q6A-RB-Ma1">
-                                    <rect key="frame" x="0.0" y="264" width="432" height="166"/>
+                                    <rect key="frame" x="0.0" y="252" width="432" height="170"/>
                                     <view key="contentView" id="bHe-mF-VFs">
-                                        <rect key="frame" x="0.0" y="0.0" width="432" height="166"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="432" height="170"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="QNR-bY-o0a" customClass="ComponentRadio" customModule="KMComponentLibrary">
-                                                <rect key="frame" x="0.0" y="94" width="98" height="32"/>
+                                                <rect key="frame" x="0.0" y="98" width="98" height="32"/>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="eN4-vv-2FB"/>
                                                     <constraint firstAttribute="width" constant="98" id="g2O-rM-rg3"/>
                                                 </constraints>
                                             </customView>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="tUV-il-jUA" customClass="ComponentRadio" customModule="KMComponentLibrary">
-                                                <rect key="frame" x="0.0" y="54" width="100" height="32"/>
+                                                <rect key="frame" x="0.0" y="58" width="100" height="32"/>
                                                 <constraints>
                                                     <constraint firstAttribute="width" constant="100" id="0Ip-y2-bce"/>
                                                     <constraint firstAttribute="height" constant="32" id="gdP-n3-RdE"/>
                                                 </constraints>
                                             </customView>
                                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="UQm-9R-ufX">
-                                                <rect key="frame" x="-2" y="138" width="436" height="16"/>
+                                                <rect key="frame" x="-2" y="142" width="436" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Split Method" id="cI1-Kj-hfi">
                                                     <font key="font" usesAppearanceFont="YES"/>
                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -93,27 +93,27 @@
                                                 </textFieldCell>
                                             </textField>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="OQ5-6X-OjQ" customClass="ComponentRadio" customModule="KMComponentLibrary">
-                                                <rect key="frame" x="0.0" y="14" width="90" height="32"/>
+                                                <rect key="frame" x="0.0" y="18" width="90" height="32"/>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="W7t-AF-CBU"/>
                                                     <constraint firstAttribute="width" constant="90" id="b6x-Js-9ra"/>
                                                 </constraints>
                                             </customView>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="VNh-Qe-w42" customClass="ComponentSelect" customModule="KMComponentLibrary">
-                                                <rect key="frame" x="98" y="14" width="334" height="32"/>
+                                                <rect key="frame" x="98" y="18" width="334" height="32"/>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="t2F-JL-BWZ"/>
                                                 </constraints>
                                             </customView>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="VtK-QB-kfV" customClass="ComponentInputNumber" customModule="KMComponentLibrary">
-                                                <rect key="frame" x="106" y="94" width="96" height="32"/>
+                                                <rect key="frame" x="106" y="98" width="96" height="32"/>
                                                 <constraints>
                                                     <constraint firstAttribute="width" constant="96" id="JPd-DV-TKo"/>
                                                     <constraint firstAttribute="height" constant="32" id="wWO-v0-kf7"/>
                                                 </constraints>
                                             </customView>
                                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="taE-wg-hAl">
-                                                <rect key="frame" x="208" y="102" width="226" height="16"/>
+                                                <rect key="frame" x="208" y="106" width="226" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="page(s) split into a PDF file" id="Xjj-Vz-9HY">
                                                     <font key="font" metaFont="system"/>
                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -121,14 +121,14 @@
                                                 </textFieldCell>
                                             </textField>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="URa-ZG-kvD" customClass="ComponentInputNumber" customModule="KMComponentLibrary">
-                                                <rect key="frame" x="108" y="54" width="96" height="32"/>
+                                                <rect key="frame" x="108" y="58" width="96" height="32"/>
                                                 <constraints>
                                                     <constraint firstAttribute="width" constant="96" id="80b-Kw-yF3"/>
                                                     <constraint firstAttribute="height" constant="32" id="xt9-QO-Oc7"/>
                                                 </constraints>
                                             </customView>
                                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hSV-Fh-E6f">
-                                                <rect key="frame" x="210" y="62" width="224" height="16"/>
+                                                <rect key="frame" x="210" y="66" width="224" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="PDF files" id="uMu-7j-jve">
                                                     <font key="font" metaFont="system"/>
                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -138,6 +138,7 @@
                                         </subviews>
                                         <constraints>
                                             <constraint firstItem="URa-ZG-kvD" firstAttribute="centerY" secondItem="tUV-il-jUA" secondAttribute="centerY" id="1sb-4R-bHQ"/>
+                                            <constraint firstItem="VNh-Qe-w42" firstAttribute="firstBaseline" secondItem="OQ5-6X-OjQ" secondAttribute="firstBaseline" id="2rq-KF-pvs"/>
                                             <constraint firstItem="URa-ZG-kvD" firstAttribute="leading" secondItem="tUV-il-jUA" secondAttribute="trailing" constant="8" id="2yC-7S-Y0P"/>
                                             <constraint firstItem="hSV-Fh-E6f" firstAttribute="centerY" secondItem="tUV-il-jUA" secondAttribute="centerY" id="2z7-DF-9e0"/>
                                             <constraint firstAttribute="trailing" secondItem="taE-wg-hAl" secondAttribute="trailing" id="37M-qP-a9U"/>
@@ -155,11 +156,10 @@
                                             <constraint firstAttribute="trailing" secondItem="UQm-9R-ufX" secondAttribute="trailing" id="cJ6-5g-Dcj"/>
                                             <constraint firstItem="UQm-9R-ufX" firstAttribute="leading" secondItem="bHe-mF-VFs" secondAttribute="leading" id="cgr-GO-8o7"/>
                                             <constraint firstAttribute="trailing" secondItem="VNh-Qe-w42" secondAttribute="trailing" id="dJz-XK-r6x"/>
-                                            <constraint firstAttribute="bottom" secondItem="OQ5-6X-OjQ" secondAttribute="bottom" constant="14" id="i5j-gK-Yez"/>
                                             <constraint firstItem="taE-wg-hAl" firstAttribute="leading" secondItem="VtK-QB-kfV" secondAttribute="trailing" constant="8" id="k0X-V6-nr0"/>
                                             <constraint firstItem="VNh-Qe-w42" firstAttribute="leading" secondItem="OQ5-6X-OjQ" secondAttribute="trailing" constant="8" id="rZW-vU-IEJ"/>
-                                            <constraint firstItem="VNh-Qe-w42" firstAttribute="centerY" secondItem="OQ5-6X-OjQ" secondAttribute="centerY" id="te3-86-2yJ"/>
                                             <constraint firstItem="UQm-9R-ufX" firstAttribute="top" secondItem="bHe-mF-VFs" secondAttribute="top" constant="12" id="xn4-HL-y7R"/>
+                                            <constraint firstAttribute="bottom" secondItem="OQ5-6X-OjQ" secondAttribute="bottom" constant="18" id="y33-u0-ixw"/>
                                         </constraints>
                                     </view>
                                 </box>
@@ -194,7 +194,7 @@
                                     </view>
                                 </box>
                                 <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="tdg-uu-noc">
-                                    <rect key="frame" x="0.0" y="184" width="432" height="64"/>
+                                    <rect key="frame" x="0.0" y="176" width="432" height="64"/>
                                     <view key="contentView" id="VRw-3a-f98">
                                         <rect key="frame" x="0.0" y="0.0" width="432" height="64"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -304,12 +304,12 @@
                                 </box>
                             </subviews>
                             <constraints>
-                                <constraint firstItem="tdg-uu-noc" firstAttribute="top" secondItem="Q6A-RB-Ma1" secondAttribute="bottom" constant="16" id="0fm-5c-iuR"/>
+                                <constraint firstItem="tdg-uu-noc" firstAttribute="top" secondItem="Q6A-RB-Ma1" secondAttribute="bottom" constant="12" id="0fm-5c-iuR"/>
                                 <constraint firstAttribute="trailing" secondItem="DNb-ku-BLc" secondAttribute="trailing" id="4GG-Cn-xuW"/>
                                 <constraint firstItem="jDk-6k-wPg" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="4zz-30-R3i"/>
                                 <constraint firstItem="Q6A-RB-Ma1" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="6Tn-tz-TQ1"/>
                                 <constraint firstAttribute="trailing" secondItem="Q6A-RB-Ma1" secondAttribute="trailing" id="7IZ-P2-tJO"/>
-                                <constraint firstItem="1WY-FC-FjB" firstAttribute="top" secondItem="tdg-uu-noc" secondAttribute="bottom" constant="8" id="7pL-ec-mTz"/>
+                                <constraint firstItem="1WY-FC-FjB" firstAttribute="top" secondItem="tdg-uu-noc" secondAttribute="bottom" id="7pL-ec-mTz"/>
                                 <constraint firstItem="DNb-ku-BLc" firstAttribute="top" secondItem="1WY-FC-FjB" secondAttribute="bottom" constant="16" id="A1L-lz-yhs"/>
                                 <constraint firstAttribute="trailing" secondItem="tdg-uu-noc" secondAttribute="trailing" id="Fu2-y9-sHw"/>
                                 <constraint firstItem="DNb-ku-BLc" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="LBX-sb-7oQ"/>
@@ -327,7 +327,7 @@
                         </constraints>
                     </box>
                     <progressIndicator maxValue="100" indeterminate="YES" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="TiY-FI-9RS">
-                        <rect key="frame" x="224" y="231" width="32" height="32"/>
+                        <rect key="frame" x="224" y="227" width="32" height="32"/>
                     </progressIndicator>
                 </subviews>
                 <constraints>