|
|
@@ -645,7 +645,8 @@ final class PaywallView: NSView, AppearanceRefreshable {
|
|
645
|
645
|
ctaButton.heightAnchor.constraint(equalToConstant: 48),
|
|
646
|
646
|
ctaButton.bottomAnchor.constraint(lessThanOrEqualTo: footerLinks.topAnchor, constant: -14),
|
|
647
|
647
|
|
|
648
|
|
- footerLinks.centerXAnchor.constraint(equalTo: panel.centerXAnchor),
|
|
|
648
|
+ footerLinks.leadingAnchor.constraint(equalTo: panel.leadingAnchor, constant: 28),
|
|
|
649
|
+ footerLinks.trailingAnchor.constraint(equalTo: panel.trailingAnchor, constant: -28),
|
|
649
|
650
|
footerLinks.bottomAnchor.constraint(equalTo: panel.bottomAnchor, constant: -20),
|
|
650
|
651
|
])
|
|
651
|
652
|
|
|
|
@@ -707,32 +708,49 @@ final class PaywallView: NSView, AppearanceRefreshable {
|
|
707
|
708
|
let termsLink = PaywallFooterLink(title: "Terms of Service")
|
|
708
|
709
|
let supportLink = PaywallFooterLink(title: "Support")
|
|
709
|
710
|
|
|
710
|
|
- let separator1 = makeFooterSeparator()
|
|
711
|
|
- let separator2 = makeFooterSeparator()
|
|
712
|
|
- let separator3 = makeFooterSeparator()
|
|
713
|
|
- let separator4 = makeFooterSeparator()
|
|
|
711
|
+ let links: [(PaywallFooterLink, Bool)] = [
|
|
|
712
|
+ (continueWithFreePlanLink, true),
|
|
|
713
|
+ (restoreLink, true),
|
|
|
714
|
+ (privacyLink, true),
|
|
|
715
|
+ (termsLink, true),
|
|
|
716
|
+ (supportLink, false),
|
|
|
717
|
+ ]
|
|
714
|
718
|
|
|
715
|
|
- let linksStack = NSStackView(views: [
|
|
716
|
|
- continueWithFreePlanLink, separator1, restoreLink, separator2, privacyLink, separator3, termsLink, separator4, supportLink,
|
|
717
|
|
- ])
|
|
|
719
|
+ let linkGroups = links.map { link, showsSeparator in
|
|
|
720
|
+ makeFooterLinkGroup(link: link, showsSeparator: showsSeparator)
|
|
|
721
|
+ }
|
|
|
722
|
+
|
|
|
723
|
+ let linksStack = NSStackView(views: linkGroups)
|
|
718
|
724
|
linksStack.orientation = .horizontal
|
|
719
|
|
- linksStack.spacing = 8
|
|
|
725
|
+ linksStack.spacing = 0
|
|
720
|
726
|
linksStack.alignment = .centerY
|
|
721
|
|
- linksStack.distribution = .fillProportionally
|
|
|
727
|
+ linksStack.distribution = .equalSpacing
|
|
722
|
728
|
linksStack.translatesAutoresizingMaskIntoConstraints = false
|
|
723
|
729
|
|
|
724
|
730
|
container.addSubview(linksStack)
|
|
725
|
731
|
NSLayoutConstraint.activate([
|
|
726
|
|
- linksStack.centerXAnchor.constraint(equalTo: container.centerXAnchor),
|
|
727
|
|
- linksStack.leadingAnchor.constraint(greaterThanOrEqualTo: container.leadingAnchor),
|
|
728
|
|
- linksStack.trailingAnchor.constraint(lessThanOrEqualTo: container.trailingAnchor),
|
|
|
732
|
+ linksStack.leadingAnchor.constraint(equalTo: container.leadingAnchor),
|
|
|
733
|
+ linksStack.trailingAnchor.constraint(equalTo: container.trailingAnchor),
|
|
729
|
734
|
linksStack.topAnchor.constraint(equalTo: container.topAnchor),
|
|
730
|
|
- linksStack.bottomAnchor.constraint(equalTo: container.bottomAnchor)
|
|
|
735
|
+ linksStack.bottomAnchor.constraint(equalTo: container.bottomAnchor),
|
|
731
|
736
|
])
|
|
732
|
737
|
|
|
733
|
738
|
return container
|
|
734
|
739
|
}
|
|
735
|
740
|
|
|
|
741
|
+ private func makeFooterLinkGroup(link: PaywallFooterLink, showsSeparator: Bool) -> NSView {
|
|
|
742
|
+ let group = NSStackView()
|
|
|
743
|
+ group.orientation = .horizontal
|
|
|
744
|
+ group.spacing = 8
|
|
|
745
|
+ group.alignment = .centerY
|
|
|
746
|
+ group.translatesAutoresizingMaskIntoConstraints = false
|
|
|
747
|
+ group.addArrangedSubview(link)
|
|
|
748
|
+ if showsSeparator {
|
|
|
749
|
+ group.addArrangedSubview(makeFooterSeparator())
|
|
|
750
|
+ }
|
|
|
751
|
+ return group
|
|
|
752
|
+ }
|
|
|
753
|
+
|
|
736
|
754
|
private func makeFooterSeparator() -> NSView {
|
|
737
|
755
|
let separator = NSView()
|
|
738
|
756
|
separator.translatesAutoresizingMaskIntoConstraints = false
|