Jelajahi Sumber

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

liujiajie 1 tahun lalu
induk
melakukan
11541ae2a1

+ 7 - 8
PDF Office/PDF Master/Class/Home/View/KMComboBox.swift

@@ -22,7 +22,7 @@ class KMComboBox: NSComboBox {
         switch type {
         case .none:
             var p = comboxRect.origin
-            p.x += comboxRect.width - 20
+            p.x += comboxRect.width - 23
             p.y += (comboxRect.height - 16) / 2
 
             NSColor.clear.setFill()
@@ -50,8 +50,8 @@ class KMComboBox: NSComboBox {
                 self.wantsLayer = true
                 self.layer?.cornerRadius = 1.0
                 self.layer?.borderWidth = 0.5
-                self.layer?.borderColor = .black
-                self.backgroundColor = .white
+                self.layer?.borderColor = KMAppearance.Interactive.s0Color().cgColor
+                self.backgroundColor = KMAppearance.Layout.w0Color()
                 self.isButtonBordered = false
             default:
                 break
@@ -63,8 +63,7 @@ class KMComboBox: NSComboBox {
 class KMComboBoxCell: NSComboBoxCell {
     private func adjustedFrameToVerticallyCenterText(_ frame: NSRect) -> NSRect {
         let offset = floor((frame.size.height / 2 - (font!.ascender + font!.descender)))
-        let rect = NSRect(x: 8, y: 0, width: frame.size.width, height: frame.size.height)
-        return NSInsetRect(rect, 0.0, offset)
+        return NSInsetRect(frame, 0.0, offset)
     }
     
     override func edit(withFrame aRect: NSRect, in controlView: NSView, editor textObj: NSText, delegate anObject: Any?, event: NSEvent?) {
@@ -82,12 +81,12 @@ class KMComboBoxCell: NSComboBoxCell {
 
 class KMStampComboBoxCell: NSComboBoxCell {
     override func drawInterior(withFrame cellFrame: NSRect, in controlView: NSView) {
-        self.backgroundColor = NSColor.white
+        backgroundColor = KMAppearance.Layout.l1Color()
         super.drawInterior(withFrame: adjustedFrameToVerticallyCenterText(cellFrame), in: controlView)
     }
     
     func adjustedFrameToVerticallyCenterText(_ frame: NSRect) -> NSRect {
-        let offset = floor((NSHeight(frame) / 2 - (font!.ascender + font!.descender)))
-        return frame.insetBy(dx: 0.0, dy: offset)
+        let offset = floor((frame.height / 2 - (font?.ascender ?? 0.0 + font!.descender)))
+        return NSInsetRect(frame, 0.0, offset)
     }
 }

File diff ditekan karena terlalu besar
+ 9 - 9
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/LeftSideView.xib


+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.m

@@ -226,12 +226,12 @@
             newAnnotation.annotationType == CAnnotationTypeSignCircle ||
             newAnnotation.annotationType == CAnnotationTypeSignLine ||
             newAnnotation.annotationType == CAnnotationTypeSignDot) {
-            KMFillSignShapePanel *vc = [[KMFillSignShapePanel alloc] init];
+            KMAnnotationSelfSignViewController *vc = [[KMAnnotationSelfSignViewController alloc] init];
             vc.pdfView = self.pdfView;
             vc.annotationModel = annotationModel;
             self.propertiesBox.contentView = vc.view;
             self.contentViewController = vc;
-            vc.callback = ^(CAnnotationType type) {
+            vc.callBack = ^(CAnnotationType type) {
                 if (type == CAnnotationTypeSignFalse) {
                     self.titleLabel.stringValue = NSLocalizedString(@"Fork", nil);
                 } else if (type == CAnnotationTypeSignTure) {
@@ -456,12 +456,12 @@
         if(_annotations.count > 1) {
             annotationModel = [[CPDFAnnotationModel alloc] initWithPDFAnnotations:_annotations];
         }
-        KMFillSignShapePanel *vc = [[KMFillSignShapePanel alloc] init];
+        KMAnnotationSelfSignViewController *vc = [[KMAnnotationSelfSignViewController alloc] init];
         vc.pdfView = self.pdfView;
         vc.annotationModel = annotationModel;
         self.propertiesBox.contentView = vc.view;
         self.contentViewController = vc;
-        vc.callback = ^(CAnnotationType type) {
+        vc.callBack = ^(CAnnotationType type) {
             if (type == CAnnotationTypeSignFalse) {
                 self.titleLabel.stringValue = NSLocalizedString(@"Fork", nil);
             } else if (type == CAnnotationTypeSignTure) {

+ 15 - 11
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMAnnotationSelfSignViewController.swift

@@ -9,13 +9,15 @@ import Cocoa
 
 typealias KMAnnotationSelfSignViewControllerCallBack = (CAnnotationType) -> Void
 
-class KMAnnotationSelfSignViewController: NSViewController {
+@objcMembers class KMAnnotationSelfSignViewController: NSViewController {
 
     var _annotations: [KMSelfSignAnnotation]?
     var selfSignType: CAnnotationType = .signText
     var pdfview: CPDFListView?
     var callBack: KMAnnotationSelfSignViewControllerCallBack?
-    
+    var pdfView: CPDFListView?
+    var annotationModel: CPDFAnnotationModel?
+
     @IBOutlet var colorLabel: NSTextField!
     @IBOutlet var imageBox: NSBox!
     @IBOutlet var imageBoxTop: NSLayoutConstraint!
@@ -105,14 +107,16 @@ class KMAnnotationSelfSignViewController: NSViewController {
             lineWidthView.isHidden = true
             lineWidthViewTopConstraint.constant = -6 - lineWidthView.bounds.size.height
         }
-
-        if annotations.count > 1 {
-            imageBoxTop.constant = -imageBox.bounds.size.height
-            imageBox.isHidden = true
-        } else {
-            imageBoxTop.constant = 10
-            imageBox.isHidden = false
-        }
+        
+//        if annotationModel?.annotations != nil {
+//            if (annotationModel?.annotations.count)! > 0 {
+//                imageBoxTop.constant = -imageBox.bounds.size.height
+//                imageBox.isHidden = true
+//            } else {
+//                imageBoxTop.constant = 10
+//                imageBox.isHidden = false
+//            }
+//        }
 
         // PickView Configuration
         colorPickView.annotationType = .selfSignColors
@@ -371,7 +375,7 @@ class KMAnnotationSelfSignViewController: NSViewController {
         imageView.image = drawImage(with: selfSignType)
     }
     
-    @IBAction func buttonClickedTypeSwitch(_ sender: NSButton) {
+    @IBAction func buttonClicked_TypeAwitch(_ sender: NSButton) {
         let tag = sender.tag
         
         for tAnnotation in annotations {

+ 5 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMAnnotationSelfSignViewController.xib

@@ -6,7 +6,7 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationSelfSignViewController">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationSelfSignViewController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="bottomView" destination="WyR-kR-Qty" id="wAo-5V-PWm"/>
                 <outlet property="circletypeButton" destination="ahQ-Ib-yZf" id="dcQ-jt-a4K"/>
@@ -26,7 +26,7 @@
                 <outlet property="opacityLabel" destination="enu-GO-p3q" id="y0U-Tl-INl"/>
                 <outlet property="opacitySlider" destination="U8k-K1-qQT" id="uby-2z-GnQ"/>
                 <outlet property="selfSignTypeLabel" destination="x0t-6o-bFa" id="cq9-jU-KVL"/>
-                <outlet property="tureTypeButton" destination="Vu3-og-LXM" id="BDX-qm-61k"/>
+                <outlet property="trueTypeButton" destination="Vu3-og-LXM" id="3UG-oW-Uuz"/>
                 <outlet property="view" destination="j0h-GU-ZZz" id="vbc-yH-dWN"/>
                 <outlet property="widthView" destination="4d3-Eg-lwC" id="e5B-Y6-3A6"/>
             </connections>
@@ -82,7 +82,7 @@
                                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                                         </textFieldCell>
                                     </textField>
-                                    <customView placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="26" translatesAutoresizingMaskIntoConstraints="NO" id="N4p-PV-4Fm" customClass="KMColorPickerView">
+                                    <customView placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="26" translatesAutoresizingMaskIntoConstraints="NO" id="N4p-PV-4Fm" customClass="KMColorPickerView" customModule="PDF_Master" customModuleProvider="target">
                                         <rect key="frame" x="0.0" y="0.0" width="341" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="32" id="KbU-gi-MOC"/>
@@ -122,7 +122,7 @@
                                             <action selector="lineWidthSliderAction:" target="-2" id="A5d-d7-f2f"/>
                                         </connections>
                                     </slider>
-                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aoL-Gs-1II" customClass="KMComboBox">
+                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aoL-Gs-1II" customClass="KMComboBox" customModule="PDF_Master" customModuleProvider="target">
                                         <rect key="frame" x="267" y="2" width="74" height="27"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="24" id="T2u-M7-u4V"/>
@@ -180,7 +180,7 @@
                                             <action selector="opacitySliderAction:" target="-2" id="fbd-rc-JlO"/>
                                         </connections>
                                     </slider>
-                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Sbs-rL-zfE" customClass="KMComboBox">
+                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Sbs-rL-zfE" customClass="KMComboBox" customModule="PDF_Master" customModuleProvider="target">
                                         <rect key="frame" x="267" y="2" width="74" height="27"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="24" id="leo-Fd-Od0"/>