Parcourir la source

【综合】登陆试图UI调整

tangchao il y a 3 mois
Parent
commit
9fb6425377

+ 90 - 0
PDF Office/PDF Master/MemberCenter/View/KMSignUpView.swift

@@ -8,6 +8,70 @@
 import Cocoa
 import Combine
 
+class KMSignUpBuyView: KMHoverView {
+    private lazy var contentBox_: NSBox = {
+        let view = NSBox()
+        view.boxType = .custom
+        view.titlePosition = .noTitle
+        view.contentViewMargins = .zero
+        view.borderWidth = 0
+        return view
+    }()
+    
+    private lazy var titleLabel_: NSTextField = {
+        let view = NSTextField(labelWithString: NSLocalizedString("Buy without Logging in", comment: ""))
+        return view
+    }()
+    
+    private lazy var subTitleLabel_: NSTextField = {
+        let view = NSTextField(wrappingLabelWithString: NSLocalizedString("Cross-platform not supported, 1-year free AI not available", comment: ""))
+        return view
+    }()
+    
+    private lazy var arrowButton_: NSButton = {
+        let view = NSButton()
+        view.isBordered = false
+        view.imagePosition = .imageOnly
+        return view
+    }()
+    
+    convenience init() {
+        self.init(frame: .init(x: 0, y: 0, width: 200, height: 40))
+        
+        initSubViews()
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        initSubViews()
+    }
+    
+    func initSubViews() {
+        let contentInset = NSEdgeInsets(top: 4, left: 8, bottom: 4, right: 8)
+        
+        addSubview(contentBox_)
+        contentBox_.km_add_inset_constraint()
+        
+        let wh: CGFloat = 16
+        contentBox_.contentView?.addSubview(arrowButton_)
+        arrowButton_.km_add_size_constraint(size: .init(width: wh, height: wh))
+        arrowButton_.km_add_trailing_constraint(constant: -contentInset.right)
+        arrowButton_.km_add_centerY_constraint()
+        
+        let hSpace: CGFloat = 4
+        contentBox_.contentView?.addSubview(titleLabel_)
+        titleLabel_.km_add_leading_constraint(constant: contentInset.left)
+        titleLabel_.km_add_top_constraint(constant: 4)
+        titleLabel_.km_add_trailing_constraint(equalTo: arrowButton_, attribute: .leading, constant: hSpace)
+        
+        contentBox_.contentView?.addSubview(subTitleLabel_)
+        subTitleLabel_.km_add_leading_constraint(constant: contentInset.left)
+        subTitleLabel_.km_add_top_constraint(equalTo: titleLabel_, attribute: .bottom)
+        subTitleLabel_.km_add_trailing_constraint(equalTo: arrowButton_, attribute: .leading, constant: hSpace)
+    }
+}
+
 class KMSignUpView: KMBaseXibView {
     
     @IBOutlet weak var signUpLabel: NSTextField!
@@ -38,6 +102,15 @@ class KMSignUpView: KMBaseXibView {
     @IBOutlet weak var signUpButton: NSButton!
     @IBOutlet weak var privacyCheckButton: NSButton!
     @IBOutlet weak var privacyLabel: NSTextField!
+    
+    @IBOutlet weak var topConst: NSLayoutConstraint!
+    @IBOutlet weak var bottomConst: NSLayoutConstraint!
+    @IBOutlet weak var checkTopConst: NSLayoutConstraint!
+    
+    private lazy var buyView_: KMSignUpBuyView = {
+        let view = KMSignUpBuyView()
+        return view
+    }()
         
     private var viewModel = KMSignUpViewModel()
     private var cancellables = Set<AnyCancellable>()
@@ -226,6 +299,23 @@ class KMSignUpView: KMBaseXibView {
         
         privacyLabel.attributedStringValue = codePrivacyAttri_
         
+#if VERSION_FREE
+#if VERSION_DMG
+#else
+        if buyView_.superview == nil {
+            addSubview(buyView_)
+            buyView_.km_add_leading_constraint(constant: 46)
+            buyView_.km_add_trailing_constraint(constant: -36)
+            buyView_.km_add_top_constraint(equalTo: privacyLabel, attribute: .bottom, constant: 8)
+            buyView_.km_add_height_constraint(constant: 51)
+        }
+        
+        self.topConst.constant = 25
+        self.bottomConst.constant = 68
+        self.checkTopConst.constant = 10
+#endif
+#endif
+        
         signUpStateChange()
         visibleStateChange()
         textfieldInputState(isEmail: true)

+ 3 - 0
PDF Office/PDF Master/MemberCenter/View/KMSignUpView.xib

@@ -9,6 +9,8 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMSignUpView" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
+                <outlet property="bottomConst" destination="Zfv-c5-vM0" id="kk9-qS-CiC"/>
+                <outlet property="checkTopConst" destination="eiD-5U-xAN" id="lyw-yr-rim"/>
                 <outlet property="emailBox" destination="44b-nP-faG" id="FFg-jd-Ryt"/>
                 <outlet property="emailErrorLabel" destination="fa7-or-CZ6" id="7T2-R9-a5H"/>
                 <outlet property="emailTextField" destination="Lob-YZ-RnN" id="pJe-6N-Rdu"/>
@@ -31,6 +33,7 @@
                 <outlet property="signUpLabel" destination="BPG-eq-njN" id="k4r-WI-LHj"/>
                 <outlet property="stayCheckButton" destination="vOR-7V-O8S" id="6R0-YC-dWB"/>
                 <outlet property="stayLabel" destination="mrO-6N-8Nu" id="I6s-vA-NeK"/>
+                <outlet property="topConst" destination="XRd-jc-QZa" id="TZV-Ui-cZO"/>
                 <outlet property="verifficationBox" destination="JUe-bQ-uSN" id="fXV-jb-Moe"/>
                 <outlet property="verifficationTextField" destination="Q4E-Ah-Yxy" id="IFj-a0-qCD"/>
                 <outlet property="verifficationView" destination="YST-rI-D70" id="FHy-CA-0Yp"/>

+ 1 - 1
PDF Office/PDF Reader Pro.xcodeproj/xcshareddata/xcschemes/PDF Reader Pro Edition.xcscheme

@@ -54,7 +54,7 @@
       </Testables>
    </TestAction>
    <LaunchAction
-      buildConfiguration = "Release"
+      buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       launchStyle = "0"