فهرست منبع

Match Indeed sidebar icon to other nav items.

Use a template glyph that tints grey when inactive and brand blue when selected, like Home and the SF Symbol rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 2 ماه پیش
والد
کامیت
469025f19a
2فایلهای تغییر یافته به همراه82 افزوده شده و 3 حذف شده
  1. 10 3
      App for Indeed/Views/DashboardView.swift
  2. 72 0
      App for Indeed/Views/IndeedLogoView.swift

+ 10 - 3
App for Indeed/Views/DashboardView.swift

@@ -172,6 +172,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
     private static let jobsPerSearchDefault = 15
     private static let jobsPerSearchMin = 1
     private static let jobsPerSearchMaxCap = 25
+    /// Matches SF Symbol nav icon footprint in sidebar rows.
+    private static let sidebarNavIconSize: CGFloat = 18
 
     private static func clampedJobsPerRequest(_ requested: Int = jobsPerSearchDefault) -> Int {
         min(jobsPerSearchMaxCap, max(jobsPerSearchMin, requested))
@@ -2615,15 +2617,20 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
         row.alignment = .centerY
         row.translatesAutoresizingMaskIntoConstraints = false
 
-        let logo = IndeedLogoView(displayHeight: 18, variant: .compact)
-        logo.translatesAutoresizingMaskIntoConstraints = false
+        let icon = NSImageView()
+        icon.translatesAutoresizingMaskIntoConstraints = false
+        icon.image = IndeedSidebarNavIcon.image(filled: isSelected)
+        icon.imageScaling = .scaleProportionallyUpOrDown
+        icon.contentTintColor = isSelected ? Theme.brandBlue : Theme.secondaryText
+        icon.widthAnchor.constraint(equalToConstant: Self.sidebarNavIconSize).isActive = true
+        icon.heightAnchor.constraint(equalToConstant: Self.sidebarNavIconSize).isActive = true
 
         let text = NSTextField(labelWithString: "Indeed")
         text.font = .systemFont(ofSize: 14, weight: .medium)
         text.textColor = isSelected ? Theme.brandBlue : Theme.secondaryText
         text.refusesFirstResponder = true
 
-        row.addArrangedSubview(logo)
+        row.addArrangedSubview(icon)
         row.addArrangedSubview(text)
 
         rowHost.addSubview(row)

+ 72 - 0
App for Indeed/Views/IndeedLogoView.swift

@@ -22,6 +22,78 @@ enum IndeedBrandLogo {
     }
 }
 
+/// Sidebar “Indeed” row icon — outline or filled template glyph tinted like SF Symbols.
+enum IndeedSidebarNavIcon {
+    private static let canvas: CGFloat = 18
+    private static var outlineImage: NSImage?
+    private static var filledImage: NSImage?
+
+    static func image(filled: Bool) -> NSImage {
+        if filled {
+            if let filledImage { return filledImage }
+            let image = makeImage(filled: true)
+            filledImage = image
+            return image
+        }
+        if let outlineImage { return outlineImage }
+        let image = makeImage(filled: false)
+        outlineImage = image
+        return image
+    }
+
+    private static func makeImage(filled: Bool) -> NSImage {
+        let size = NSSize(width: canvas, height: canvas)
+        let image = NSImage(size: size, flipped: true) { _ in
+            if filled {
+                drawFilledMark()
+            } else {
+                drawOutlineMark()
+            }
+            return true
+        }
+        image.isTemplate = true
+        return image
+    }
+
+    /// Stylized “i” mark (dot + stem + brow) aligned with SF Symbol nav icons.
+    private static func drawOutlineMark() {
+        let stroke: CGFloat = 1.25
+        NSColor.black.setStroke()
+
+        let dot = NSBezierPath(ovalIn: NSRect(x: 7.2, y: 2.8, width: 3.6, height: 3.6))
+        dot.lineWidth = stroke
+        dot.stroke()
+
+        let stem = NSBezierPath(roundedRect: NSRect(x: 7.2, y: 7.2, width: 3.6, height: 8.2), xRadius: 1.8, yRadius: 1.8)
+        stem.lineWidth = stroke
+        stem.stroke()
+
+        let brow = NSBezierPath()
+        brow.move(to: NSPoint(x: 4.6, y: 6.4))
+        brow.curve(to: NSPoint(x: 13.4, y: 6.4), controlPoint1: NSPoint(x: 6.2, y: 2.2), controlPoint2: NSPoint(x: 11.8, y: 2.2))
+        brow.lineWidth = stroke
+        brow.lineCapStyle = .round
+        brow.stroke()
+    }
+
+    private static func drawFilledMark() {
+        NSColor.black.setFill()
+
+        let dot = NSBezierPath(ovalIn: NSRect(x: 7.2, y: 2.8, width: 3.6, height: 3.6))
+        dot.fill()
+
+        let stem = NSBezierPath(roundedRect: NSRect(x: 7.2, y: 7.2, width: 3.6, height: 8.2), xRadius: 1.8, yRadius: 1.8)
+        stem.fill()
+
+        let brow = NSBezierPath()
+        brow.move(to: NSPoint(x: 4.6, y: 6.4))
+        brow.curve(to: NSPoint(x: 13.4, y: 6.4), controlPoint1: NSPoint(x: 6.2, y: 2.2), controlPoint2: NSPoint(x: 11.8, y: 2.2))
+        brow.lineWidth = 1.35
+        brow.lineCapStyle = .round
+        brow.stroke()
+    }
+}
+
 final class IndeedLogoView: NSView {
     private let imageView = NSImageView()
     private let variant: IndeedBrandLogo.Variant