Pārlūkot izejas kodu

Make sidebar nav selection span full sidebar width

Pin each SidebarNavRowView width to the sidebar minus horizontal
edge insets and lower horizontal content hugging so the active
row highlight fills the usable bar instead of hugging icon+label.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 2 mēneši atpakaļ
vecāks
revīzija
a4aa901e93
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      App for Indeed/Views/DashboardView.swift

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

@@ -320,7 +320,10 @@ final class DashboardView: NSView {
                 row.topAnchor.constraint(equalTo: rowHost.topAnchor, constant: 8),
                 row.bottomAnchor.constraint(equalTo: rowHost.bottomAnchor, constant: -8)
             ])
+            rowHost.setContentHuggingPriority(.defaultLow, for: .horizontal)
             sidebar.addArrangedSubview(rowHost)
+            let sidebarHorizontalInset = sidebar.edgeInsets.left + sidebar.edgeInsets.right
+            rowHost.widthAnchor.constraint(equalTo: sidebar.widthAnchor, constant: -sidebarHorizontalInset).isActive = true
         }
 
         let sidebarBottomSpacer = NSView()