|
|
@@ -2,26 +2,22 @@ import Cocoa
|
|
2
|
2
|
import StoreKit
|
|
3
|
3
|
|
|
4
|
4
|
final class PremiumPlansWindowController: NSWindowController {
|
|
|
5
|
+ /// Matches `PremiumPlansViewController.Theme.pageStart` so the window backing fills sheet corners.
|
|
|
6
|
+ static let paywallSheetBackground = NSColor(srgbRed: 249 / 255, green: 252 / 255, blue: 255 / 255, alpha: 1)
|
|
|
7
|
+
|
|
5
|
8
|
init() {
|
|
6
|
9
|
let viewController = PremiumPlansViewController()
|
|
7
|
10
|
let window = NSWindow(contentViewController: viewController)
|
|
8
|
11
|
window.title = "Premium Plans"
|
|
9
|
|
- window.styleMask = [.titled, .closable, .miniaturizable, .resizable]
|
|
10
|
|
- window.styleMask.insert(.fullSizeContentView)
|
|
11
|
|
- window.titlebarAppearsTransparent = true
|
|
12
|
|
- window.titleVisibility = .hidden
|
|
13
|
|
- window.isOpaque = false
|
|
14
|
|
- window.backgroundColor = .clear
|
|
|
12
|
+ // Borderless avoids titled-window chrome: its rounded titlebar frame often leaves dark wedges at
|
|
|
13
|
+ // the corners when combined with a custom full-bleed paywall (this window is only shown as a sheet).
|
|
|
14
|
+ window.styleMask = [.borderless, .closable, .resizable]
|
|
|
15
|
+ window.isOpaque = true
|
|
|
16
|
+ window.backgroundColor = Self.paywallSheetBackground
|
|
15
|
17
|
window.setContentSize(NSSize(width: 1160, height: 760))
|
|
16
|
18
|
window.minSize = NSSize(width: 980, height: 680)
|
|
17
|
19
|
window.center()
|
|
18
|
20
|
super.init(window: window)
|
|
19
|
|
-
|
|
20
|
|
- if let frameView = window.contentView?.superview {
|
|
21
|
|
- frameView.wantsLayer = true
|
|
22
|
|
- frameView.layer?.cornerRadius = 18
|
|
23
|
|
- frameView.layer?.masksToBounds = true
|
|
24
|
|
- }
|
|
25
|
21
|
}
|
|
26
|
22
|
|
|
27
|
23
|
@available(*, unavailable)
|
|
|
@@ -498,8 +494,6 @@ private final class PremiumPlansViewController: NSViewController {
|
|
498
|
494
|
override func loadView() {
|
|
499
|
495
|
view = NSView()
|
|
500
|
496
|
view.wantsLayer = true
|
|
501
|
|
- view.layer?.cornerRadius = 18
|
|
502
|
|
- view.layer?.masksToBounds = true
|
|
503
|
497
|
pageGradient.colors = [Theme.pageStart.cgColor, Theme.pageEnd.cgColor]
|
|
504
|
498
|
pageGradient.startPoint = CGPoint(x: 0, y: 1)
|
|
505
|
499
|
pageGradient.endPoint = CGPoint(x: 1, y: 0)
|