فهرست منبع

【综合】注释,筛选弹窗,按钮文字和按钮背景之间左右边距不对(已修复)

tangchao 1 سال پیش
والد
کامیت
44ae051923

+ 7 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/Controller/KMNoteOutlineFilterViewController.swift

@@ -9,6 +9,9 @@ import Cocoa
 
 class KMNoteOutlineFilterViewController: NSViewController {
     
+    @IBOutlet weak var cancelWidthConst: NSLayoutConstraint!
+    @IBOutlet weak var applyWidthConst: NSLayoutConstraint!
+    
     private var _notesArray: NSArray?
     func setNotesArray(_ notesArray: NSArray?) {
         self._notesArray = notesArray
@@ -155,9 +158,13 @@ class KMNoteOutlineFilterViewController: NSViewController {
         self.cancelButton.title = KMLocalizedString("Cancel", nil)
         self.cancelButton.setTitleColor(KMAppearance.Layout.h0Color())
         self.cancelButton.wantsLayer = true
+        let cwidth = self.cancelButton.title.boundingRect(with: CGSizeMake(CGFloat(MAXFLOAT), 20), options: .usesLineFragmentOrigin, attributes: [.font : self.cancelButton.font ?? NSFont.systemFont(ofSize: 12)]).size.width
+        self.cancelWidthConst.constant = cwidth + 7 * 2
         self.OKButton.title = KMLocalizedString("Apply", nil)
         self.OKButton.setTitleColor(KMAppearance.Layout.w0Color())
         self.OKButton.wantsLayer = true
+        let owidth = self.OKButton.title.boundingRect(with: CGSizeMake(CGFloat(MAXFLOAT), 20), options: .usesLineFragmentOrigin, attributes: [.font : self.OKButton.font ?? NSFont.systemFont(ofSize: 12)]).size.width
+        self.applyWidthConst.constant = owidth + 7 * 2
         
         self.cancelButton.layer?.cornerRadius = 1.0
         self.OKButton.layer?.cornerRadius = 1.0

+ 4 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/Controller/KMNoteOutlineFilterViewController.xib

@@ -9,11 +9,13 @@
         <customObject id="-2" userLabel="File's Owner" customClass="KMNoteOutlineFilterViewController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="OKButton" destination="Q36-TR-heS" id="IIb-by-xE2"/>
+                <outlet property="applyWidthConst" destination="DNw-rt-8Kg" id="CkL-dg-WE9"/>
                 <outlet property="authorCollectionView" destination="JRW-Bz-9mG" id="ZR3-uv-kg3"/>
                 <outlet property="authorLabel" destination="VN7-0X-D4D" id="EmL-Od-xwS"/>
                 <outlet property="authorView" destination="cWw-c2-7RY" id="dZG-PD-3mx"/>
                 <outlet property="authorViewLayoutConstraint" destination="LVP-0T-T7B" id="Ber-cl-Phq"/>
                 <outlet property="cancelButton" destination="NFm-Ab-DKE" id="Tkn-2F-Zji"/>
+                <outlet property="cancelWidthConst" destination="beN-sL-nSt" id="Gt7-Mx-7Sy"/>
                 <outlet property="clearButton" destination="UNs-mG-fAZ" id="1c2-CR-lfE"/>
                 <outlet property="colorCollectionView" destination="5c3-T3-j1n" id="xKm-cW-tnG"/>
                 <outlet property="colorLabel" destination="Y44-QV-S6X" id="0s8-yu-zGf"/>
@@ -47,6 +49,7 @@
                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NFm-Ab-DKE">
                     <rect key="frame" x="150" y="14" width="45" height="24"/>
                     <constraints>
+                        <constraint firstAttribute="width" constant="45" id="beN-sL-nSt"/>
                         <constraint firstAttribute="height" constant="24" id="tbI-9N-Fmb"/>
                     </constraints>
                     <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="j9x-X9-0Kg">
@@ -60,6 +63,7 @@
                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Q36-TR-heS">
                     <rect key="frame" x="203" y="14" width="45" height="24"/>
                     <constraints>
+                        <constraint firstAttribute="width" constant="45" id="DNw-rt-8Kg"/>
                         <constraint firstAttribute="height" constant="24" id="irV-Yr-j2H"/>
                     </constraints>
                     <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="Q9N-tH-yc5">

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -511,7 +511,7 @@ class KMLeftSideViewController: KMSideViewController {
                 self.refreshMethodType(methodType: .Thumbnail)
                 DispatchQueue.main.async {
                     self.toolButtonBox.contentView = self.thumbnailView
-                    self.displayThumbnailViewAnimating(true)
+                    self.displayThumbnailViewAnimating(false)
                 }
             } else if (segIndex == 1) {
                 if self.type.methodType == .Outline {