|
|
@@ -1859,9 +1859,26 @@ private extension ViewController {
|
|
1859
|
1859
|
}
|
|
1860
|
1860
|
|
|
1861
|
1861
|
private func makeWidgetsPageContent() -> NSView {
|
|
1862
|
|
- makeWidgetsPageHost(canAddWidgets: storeKitCoordinator.hasPremiumAccess) { [weak self] in
|
|
|
1862
|
+ let panel = NSView()
|
|
|
1863
|
+ panel.translatesAutoresizingMaskIntoConstraints = false
|
|
|
1864
|
+
|
|
|
1865
|
+ let host = makeWidgetsPageHost(canAddWidgets: storeKitCoordinator.hasPremiumAccess) { [weak self] in
|
|
1863
|
1866
|
self?.showPaywall()
|
|
1864
|
1867
|
}
|
|
|
1868
|
+ panel.addSubview(host)
|
|
|
1869
|
+
|
|
|
1870
|
+ NSLayoutConstraint.activate([
|
|
|
1871
|
+ host.leadingAnchor.constraint(equalTo: panel.leadingAnchor, constant: 28),
|
|
|
1872
|
+ host.trailingAnchor.constraint(equalTo: panel.trailingAnchor, constant: -28),
|
|
|
1873
|
+ host.topAnchor.constraint(equalTo: panel.topAnchor),
|
|
|
1874
|
+ host.bottomAnchor.constraint(lessThanOrEqualTo: panel.bottomAnchor, constant: -16)
|
|
|
1875
|
+ ])
|
|
|
1876
|
+
|
|
|
1877
|
+ // Keep widgets anchored to the top instead of drifting vertically in tall windows.
|
|
|
1878
|
+ host.setContentHuggingPriority(.required, for: .vertical)
|
|
|
1879
|
+ host.setContentCompressionResistancePriority(.required, for: .vertical)
|
|
|
1880
|
+
|
|
|
1881
|
+ return panel
|
|
1865
|
1882
|
}
|
|
1866
|
1883
|
|
|
1867
|
1884
|
private func makePlaceholderPage(title: String, subtitle: String) -> NSView {
|