Просмотр исходного кода

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 недель назад: 3
Родитель
Сommit
a4aa901e93
1 измененных файлов с 3 добавлено и 0 удалено
  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 {
320 320
                 row.topAnchor.constraint(equalTo: rowHost.topAnchor, constant: 8),
321 321
                 row.bottomAnchor.constraint(equalTo: rowHost.bottomAnchor, constant: -8)
322 322
             ])
323
+            rowHost.setContentHuggingPriority(.defaultLow, for: .horizontal)
323 324
             sidebar.addArrangedSubview(rowHost)
325
+            let sidebarHorizontalInset = sidebar.edgeInsets.left + sidebar.edgeInsets.right
326
+            rowHost.widthAnchor.constraint(equalTo: sidebar.widthAnchor, constant: -sidebarHorizontalInset).isActive = true
324 327
         }
325 328
 
326 329
         let sidebarBottomSpacer = NSView()