Browse Source

【视图】阅读模式缩放值逻辑调整

lizhe 1 year ago
parent
commit
48b5e15037

+ 5 - 5
PDF Office/PDF Master/Class/PDFWindowController/ReadModelView/KMReadModelView.swift

@@ -76,11 +76,11 @@ class KMReadModelView: KMBaseXibView {
     @IBOutlet weak var contentBox: KMBox!
     
     
-    fileprivate var firstPageButton: KMDesignButton!
-    fileprivate var beforePageButton: KMDesignButton!
-    fileprivate var afterPageButton: KMDesignButton!
-    fileprivate var lastPageButton: KMDesignButton!
-    fileprivate var zoomButton: KMDesignSelect!
+    var firstPageButton: KMDesignButton!
+    var beforePageButton: KMDesignButton!
+    var afterPageButton: KMDesignButton!
+    var lastPageButton: KMDesignButton!
+    var zoomButton: KMDesignSelect!
     
     var timer: Timer?
     weak var delegate: KMReadModelViewDelegate?

+ 4 - 5
PDF Office/PDF Master/Class/PDFWindowController/ReadModelView/KMReadModelView.xib

@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMReadModelView" customModule="PDF_Office" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMReadModelView" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="afterPageView" destination="ViC-c6-CX9" id="ljl-v7-7PX"/>
                 <outlet property="backgroundContentView" destination="Ekg-BM-HXY" id="7Ro-oj-0oJ"/>
@@ -31,7 +30,7 @@
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ekg-BM-HXY">
                     <rect key="frame" x="269" y="0.0" width="355" height="32"/>
                     <subviews>
-                        <box boxType="custom" borderWidth="0.0" cornerRadius="4" translatesAutoresizingMaskIntoConstraints="NO" id="AVK-lu-Leb" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
+                        <box boxType="custom" borderWidth="0.0" cornerRadius="4" translatesAutoresizingMaskIntoConstraints="NO" id="AVK-lu-Leb" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
                             <rect key="frame" x="0.0" y="0.0" width="355" height="32"/>
                             <view key="contentView" id="U9O-MP-lEy">
                                 <rect key="frame" x="0.0" y="0.0" width="355" height="32"/>

+ 3 - 2
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -478,8 +478,9 @@ extension KMMainViewController {
         self.readModelView.currentPageIndex = self.listView.currentPageIndex
         self.readModelView.totalPagesCount = Int(self.listView.document.pageCount)
         self.readModelView.beginTimer()
-        self.listView.autoScales = true
-        self.readModelView.scaleType = .autoSize
+//        self.listView.autoScales = true
+//        self.readModelView.scaleType = .autoSize
+        self.readModelView.zoomButton.stringValue = (self.listView.scaleFactor * 100).description + "%"
         
         //关闭左侧右侧菜单栏
         self.closeLeftPane()