|
|
@@ -1859,9 +1859,26 @@ private extension ViewController {
|
|
|
}
|
|
|
|
|
|
private func makeWidgetsPageContent() -> NSView {
|
|
|
- makeWidgetsPageHost(canAddWidgets: storeKitCoordinator.hasPremiumAccess) { [weak self] in
|
|
|
+ let panel = NSView()
|
|
|
+ panel.translatesAutoresizingMaskIntoConstraints = false
|
|
|
+
|
|
|
+ let host = makeWidgetsPageHost(canAddWidgets: storeKitCoordinator.hasPremiumAccess) { [weak self] in
|
|
|
self?.showPaywall()
|
|
|
}
|
|
|
+ panel.addSubview(host)
|
|
|
+
|
|
|
+ NSLayoutConstraint.activate([
|
|
|
+ host.leadingAnchor.constraint(equalTo: panel.leadingAnchor, constant: 28),
|
|
|
+ host.trailingAnchor.constraint(equalTo: panel.trailingAnchor, constant: -28),
|
|
|
+ host.topAnchor.constraint(equalTo: panel.topAnchor),
|
|
|
+ host.bottomAnchor.constraint(lessThanOrEqualTo: panel.bottomAnchor, constant: -16)
|
|
|
+ ])
|
|
|
+
|
|
|
+ // Keep widgets anchored to the top instead of drifting vertically in tall windows.
|
|
|
+ host.setContentHuggingPriority(.required, for: .vertical)
|
|
|
+ host.setContentCompressionResistancePriority(.required, for: .vertical)
|
|
|
+
|
|
|
+ return panel
|
|
|
}
|
|
|
|
|
|
private func makePlaceholderPage(title: String, subtitle: String) -> NSView {
|