|
|
@@ -708,23 +708,21 @@ final class PaywallView: NSView, AppearanceRefreshable {
|
|
|
let termsLink = PaywallFooterLink(title: "Terms of Service")
|
|
|
let supportLink = PaywallFooterLink(title: "Support")
|
|
|
|
|
|
- let links: [(PaywallFooterLink, Bool)] = [
|
|
|
- (continueWithFreePlanLink, true),
|
|
|
- (restoreLink, true),
|
|
|
- (privacyLink, true),
|
|
|
- (termsLink, true),
|
|
|
- (supportLink, false),
|
|
|
+ let links = [
|
|
|
+ continueWithFreePlanLink,
|
|
|
+ restoreLink,
|
|
|
+ privacyLink,
|
|
|
+ termsLink,
|
|
|
+ supportLink,
|
|
|
]
|
|
|
|
|
|
- let linkGroups = links.map { link, showsSeparator in
|
|
|
- makeFooterLinkGroup(link: link, showsSeparator: showsSeparator)
|
|
|
- }
|
|
|
+ let linkCells = links.map { makeFooterLinkCell(link: $0) }
|
|
|
|
|
|
- let linksStack = NSStackView(views: linkGroups)
|
|
|
+ let linksStack = NSStackView(views: linkCells)
|
|
|
linksStack.orientation = .horizontal
|
|
|
linksStack.spacing = 0
|
|
|
linksStack.alignment = .centerY
|
|
|
- linksStack.distribution = .equalSpacing
|
|
|
+ linksStack.distribution = .fillEqually
|
|
|
linksStack.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
container.addSubview(linksStack)
|
|
|
@@ -738,29 +736,19 @@ final class PaywallView: NSView, AppearanceRefreshable {
|
|
|
return container
|
|
|
}
|
|
|
|
|
|
- private func makeFooterLinkGroup(link: PaywallFooterLink, showsSeparator: Bool) -> NSView {
|
|
|
- let group = NSStackView()
|
|
|
- group.orientation = .horizontal
|
|
|
- group.spacing = 8
|
|
|
- group.alignment = .centerY
|
|
|
- group.translatesAutoresizingMaskIntoConstraints = false
|
|
|
- group.addArrangedSubview(link)
|
|
|
- if showsSeparator {
|
|
|
- group.addArrangedSubview(makeFooterSeparator())
|
|
|
- }
|
|
|
- return group
|
|
|
- }
|
|
|
+ private func makeFooterLinkCell(link: PaywallFooterLink) -> NSView {
|
|
|
+ let cell = NSView()
|
|
|
+ cell.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
- private func makeFooterSeparator() -> NSView {
|
|
|
- let separator = NSView()
|
|
|
- separator.translatesAutoresizingMaskIntoConstraints = false
|
|
|
- separator.wantsLayer = true
|
|
|
- separator.layer?.backgroundColor = AppTheme.paywallBorder.cgColor
|
|
|
+ cell.addSubview(link)
|
|
|
NSLayoutConstraint.activate([
|
|
|
- separator.widthAnchor.constraint(equalToConstant: 1),
|
|
|
- separator.heightAnchor.constraint(equalToConstant: 12),
|
|
|
+ link.centerXAnchor.constraint(equalTo: cell.centerXAnchor),
|
|
|
+ link.centerYAnchor.constraint(equalTo: cell.centerYAnchor),
|
|
|
+ link.topAnchor.constraint(equalTo: cell.topAnchor),
|
|
|
+ link.bottomAnchor.constraint(equalTo: cell.bottomAnchor),
|
|
|
])
|
|
|
- return separator
|
|
|
+
|
|
|
+ return cell
|
|
|
}
|
|
|
|
|
|
private func selectPlan(_ plan: PaywallPlan) {
|