소스 검색

Refine premium and dashboard window corner styling.

Align rounded edge clipping across the main and subscription windows, and remove the duplicated "Most Popular" badge treatments from the premium card layout for a cleaner UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 2 달 전
부모
커밋
3321b41e84
2개의 변경된 파일16개의 추가작업 그리고 47개의 파일을 삭제
  1. 14 46
      App for Indeed/Controllers/PremiumPlansWindowController.swift
  2. 2 1
      App for Indeed/Views/DashboardView.swift

+ 14 - 46
App for Indeed/Controllers/PremiumPlansWindowController.swift

@@ -6,10 +6,21 @@ final class PremiumPlansWindowController: NSWindowController {
         let window = NSWindow(contentViewController: viewController)
         window.title = "Premium Plans"
         window.styleMask = [.titled, .closable, .miniaturizable, .resizable]
+        window.styleMask.insert(.fullSizeContentView)
+        window.titlebarAppearsTransparent = true
+        window.titleVisibility = .hidden
+        window.isOpaque = false
+        window.backgroundColor = .clear
         window.setContentSize(NSSize(width: 1160, height: 760))
         window.minSize = NSSize(width: 980, height: 680)
         window.center()
         super.init(window: window)
+
+        if let frameView = window.contentView?.superview {
+            frameView.wantsLayer = true
+            frameView.layer?.cornerRadius = 18
+            frameView.layer?.masksToBounds = true
+        }
     }
 
     @available(*, unavailable)
@@ -77,7 +88,7 @@ private final class PremiumPlansViewController: NSViewController {
             subtitle: "Balanced for regular productivity",
             price: "$19.99",
             period: "/ month",
-            billedPill: "Most Popular",
+            billedPill: "",
             billedLine: "",
             crossedPrice: nil,
             savingsText: nil,
@@ -112,26 +123,16 @@ private final class PremiumPlansViewController: NSViewController {
     ]
 
     private let pageGradient = CAGradientLayer()
-    private lazy var popularGradient: CAGradientLayer = {
-        let layer = CAGradientLayer()
-        layer.colors = [
-            NSColor(srgbRed: 189 / 255, green: 52 / 255, blue: 255 / 255, alpha: 1).cgColor,
-            NSColor(srgbRed: 73 / 255, green: 153 / 255, blue: 255 / 255, alpha: 1).cgColor
-        ]
-        layer.startPoint = CGPoint(x: 0, y: 0.5)
-        layer.endPoint = CGPoint(x: 1, y: 0.5)
-        return layer
-    }()
-
     override func viewDidLayout() {
         super.viewDidLayout()
         pageGradient.frame = view.bounds
-        popularGradient.frame = CGRect(x: 0, y: 0, width: 160, height: 22)
     }
 
     override func loadView() {
         view = NSView()
         view.wantsLayer = true
+        view.layer?.cornerRadius = 18
+        view.layer?.masksToBounds = true
         pageGradient.colors = [Theme.pageStart.cgColor, Theme.pageEnd.cgColor]
         pageGradient.startPoint = CGPoint(x: 0, y: 1)
         pageGradient.endPoint = CGPoint(x: 1, y: 0)
@@ -293,39 +294,6 @@ private final class PremiumPlansViewController: NSViewController {
             selectButton.widthAnchor.constraint(equalTo: content.widthAnchor)
         ])
 
-        if plan.highlight {
-            let badgeHost = NSView()
-            badgeHost.translatesAutoresizingMaskIntoConstraints = false
-            badgeHost.wantsLayer = true
-            badgeHost.layer?.cornerRadius = 14
-            badgeHost.layer?.masksToBounds = true
-            badgeHost.layer?.addSublayer(popularGradient)
-
-            let sparkle = NSImageView()
-            sparkle.translatesAutoresizingMaskIntoConstraints = false
-            sparkle.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 10, weight: .semibold)
-            sparkle.image = NSImage(systemSymbolName: "sparkles", accessibilityDescription: nil)
-            sparkle.contentTintColor = .white
-
-            let badge = NSTextField(labelWithString: "Most Popular")
-            badge.font = .systemFont(ofSize: 12, weight: .bold)
-            badge.textColor = .white
-
-            badgeHost.addSubview(sparkle)
-            badgeHost.addSubview(badge)
-            card.addSubview(badgeHost)
-            NSLayoutConstraint.activate([
-                badgeHost.trailingAnchor.constraint(equalTo: card.trailingAnchor, constant: -14),
-                badgeHost.topAnchor.constraint(equalTo: card.topAnchor, constant: 10),
-                badgeHost.widthAnchor.constraint(equalToConstant: 160),
-                badgeHost.heightAnchor.constraint(equalToConstant: 22),
-                sparkle.leadingAnchor.constraint(equalTo: badgeHost.leadingAnchor, constant: 14),
-                sparkle.centerYAnchor.constraint(equalTo: badgeHost.centerYAnchor),
-                badge.leadingAnchor.constraint(equalTo: sparkle.trailingAnchor, constant: 6),
-                badge.centerYAnchor.constraint(equalTo: badgeHost.centerYAnchor)
-            ])
-        }
-
         return card
     }
 

+ 2 - 1
App for Indeed/Views/DashboardView.swift

@@ -183,7 +183,8 @@ final class DashboardView: NSView, NSTextFieldDelegate {
         chromeContainer.translatesAutoresizingMaskIntoConstraints = false
         chromeContainer.wantsLayer = true
         chromeContainer.layer?.backgroundColor = Theme.chromeBackground.cgColor
-        chromeContainer.layer?.cornerRadius = 0
+        chromeContainer.layer?.cornerRadius = 18
+        chromeContainer.layer?.masksToBounds = true
         addSubview(chromeContainer)
         chromeContainer.addSubview(contentStack)