Переглянути джерело

【fix】【窗口】新功能、免费试用等弹窗未居中显示

tangchao 4 місяців тому
батько
коміт
500c616bd7

+ 1 - 1
PDF Office/PDF Master/Class/AD/KMAdsWebView.swift

@@ -152,7 +152,7 @@ class KMAdsWebView: NSView, WKNavigationDelegate, CAAnimationDelegate {
     
     func reloadData() {
         DispatchQueue.main.async {
-            self.adsImageView.image = self.adsInfo.adsImage
+            self.adsImageView.image = self.adsInfo?.adsImage
         }
     }
 

+ 7 - 0
PDF Office/PDF Master/Class/GuideInfo/KMCouponDueWindowController.swift

@@ -59,6 +59,13 @@ class KMCouponDueWindowController: NSWindowController {
 
     }
     
+    override func showWindow(_ sender: Any?) {
+        super.showWindow(sender)
+        
+        self.window?.isRestorable = false
+//        self.window?.center()
+    }
+    
     func refreshUI() {
         if KMAppearance.isDarkMode() {
             self.window?.contentView?.layer?.backgroundColor = NSColor(red: 24/255, green: 22/255, blue: 31/255, alpha: 1).cgColor

+ 6 - 7
PDF Office/PDF Master/Class/GuideInfo/KMCouponDueWindowController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" 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="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="Named colors" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -25,9 +25,8 @@
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
-            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="660" height="443"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
             <value key="minSize" type="size" width="660" height="443"/>
             <value key="maxSize" type="size" width="660" height="443"/>
             <view key="contentView" id="se5-gp-TjO">
@@ -60,7 +59,7 @@
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="IRn-Nx-1SH">
                                     <rect key="frame" x="336" y="21" width="266" height="338"/>
                                     <subviews>
-                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mL0-nw-nO3">
+                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mL0-nw-nO3">
                                             <rect key="frame" x="-2" y="313" width="172" height="25"/>
                                             <textFieldCell key="cell" alignment="left" title="Limited-time Offer" id="Dv5-Ir-uCY">
                                                 <font key="font" metaFont="system" size="21"/>
@@ -68,7 +67,7 @@
                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                             </textFieldCell>
                                         </textField>
-                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jjn-yZ-D7c">
+                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jjn-yZ-D7c">
                                             <rect key="frame" x="-2" y="258" width="270" height="51"/>
                                             <constraints>
                                                 <constraint firstAttribute="width" constant="266" id="6J1-BA-Y1S"/>
@@ -118,7 +117,7 @@
                                             </constraints>
                                             <color key="fillColor" red="1" green="0.61799015410958902" blue="0.16566780821917809" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         </box>
-                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VRY-Yk-fAD">
+                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VRY-Yk-fAD">
                                             <rect key="frame" x="-2" y="20" width="270" height="14"/>
                                             <constraints>
                                                 <constraint firstAttribute="width" constant="266" id="5bJ-Fv-1Zy"/>

+ 3 - 4
PDF Office/PDF Master/Class/GuideInfo/KMFunctionGuideWindowController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" 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="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -16,9 +16,8 @@
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
-            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="574" height="387"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="574" height="387"/>
                 <autoresizingMask key="autoresizingMask"/>