Sfoglia il codice sorgente

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

tangchao 5 mesi fa
parent
commit
9ebc60aa83

+ 26 - 0
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -17,6 +17,10 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     @IBOutlet weak var contentBox: NSBox!
     
     @IBOutlet weak var thumbnailSizeView: NSView!
+    @IBOutlet weak var zoomInButton: NSButton!
+
+    @IBOutlet weak var zoomOutButton: NSButton!
+
     @IBOutlet weak var lineBoxView: NSView!
     
     
@@ -1295,6 +1299,17 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
 //        }
         KMThumbnailCache.shared.clearCache()
         self.pageEditThumbnailView.zoomOut()
+        if pageEditThumbnailView.canZoomIn() {
+            zoomOutButton.isEnabled = true
+        } else {
+            zoomOutButton.isEnabled = false
+        }
+        
+        if pageEditThumbnailView.canZoomOut() {
+            zoomInButton.isEnabled = true
+        } else {
+            zoomInButton.isEnabled = false
+        }
     }
     
     @objc func zoomInButtonAction(sender: NSButton?) {
@@ -1314,6 +1329,17 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
 //        }
         KMThumbnailCache.shared.clearCache()
         self.pageEditThumbnailView.zoomIn()
+        if pageEditThumbnailView.canZoomIn() {
+            zoomOutButton.isEnabled = true
+        } else {
+            zoomOutButton.isEnabled = false
+        }
+        
+        if pageEditThumbnailView.canZoomOut() {
+            zoomInButton.isEnabled = true
+        } else {
+            zoomInButton.isEnabled = false
+        }
     }
     
     // MARK: menu 菜单事件

+ 4 - 2
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -13,6 +13,8 @@
                 <outlet property="thumbnailSizeView" destination="Jf5-OZ-sXa" id="Pib-0f-y8b"/>
                 <outlet property="topBarBox" destination="9MH-c6-Ein" id="4yW-J4-TfZ"/>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+                <outlet property="zoomInButton" destination="AzX-4N-uaa" id="JQW-pf-WOr"/>
+                <outlet property="zoomOutButton" destination="nbB-12-iF1" id="owX-0d-ktI"/>
             </connections>
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>