浏览代码

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 月之前
父节点
当前提交
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 {
                 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()