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

Tighten sidebar spacing between brand title and nav rows

Remove the fixed title-to-menu spacer and use stack custom spacing
instead. Cap the brand label to two lines with a preferred max width so
multiline NSTextField does not inflate vertical space.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 недель назад: 3
Родитель
Сommit
32c0ac60f8
1 измененных файлов с 4 добавлено и 5 удалено
  1. 4 5
      App for Indeed/Views/DashboardView.swift

+ 4 - 5
App for Indeed/Views/DashboardView.swift

@@ -1190,12 +1190,11 @@ final class DashboardView: NSView, NSTextFieldDelegate {
1190
         brand.font = .systemFont(ofSize: 18, weight: .bold)
1190
         brand.font = .systemFont(ofSize: 18, weight: .bold)
1191
         brand.textColor = Theme.brandBlue
1191
         brand.textColor = Theme.brandBlue
1192
         brand.alignment = .left
1192
         brand.alignment = .left
1193
+        brand.maximumNumberOfLines = 2
1194
+        // Tight multiline height in the sidebar stack (zero width makes intrinsic height unreliable).
1195
+        brand.preferredMaxLayoutWidth = 194
1193
         sidebar.addArrangedSubview(brand)
1196
         sidebar.addArrangedSubview(brand)
1194
-
1195
-        let titleToMenuSpacer = NSView()
1196
-        titleToMenuSpacer.translatesAutoresizingMaskIntoConstraints = false
1197
-        titleToMenuSpacer.heightAnchor.constraint(equalToConstant: 24).isActive = true
1198
-        sidebar.addArrangedSubview(titleToMenuSpacer)
1197
+        sidebar.setCustomSpacing(10, after: brand)
1199
 
1198
 
1200
         items.enumerated().forEach { index, item in
1199
         items.enumerated().forEach { index, item in
1201
             let isSelected = index == selectedSidebarIndex
1200
             let isSelected = index == selectedSidebarIndex