Browse Source

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 months ago
parent
commit
a4aa901e93
1 changed files with 3 additions and 0 deletions
  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()