Bladeren bron

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 maanden geleden
bovenliggende
commit
a4aa901e93
1 gewijzigde bestanden met toevoegingen van 3 en 0 verwijderingen
  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()