Kaynağa Gözat

Make dashboard chrome fill the window edge to edge.

Pin chromeContainer to documentContainer without horizontal or vertical
insets, remove the max width cap, zero outer corner radius, and adjust
document height calculation now that outer margins are gone.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 3 hafta önce
ebeveyn
işleme
6a7062e6a7
1 değiştirilmiş dosya ile 6 ekleme ve 7 silme
  1. 6 7
      App for Indeed/Views/DashboardView.swift

+ 6 - 7
App for Indeed/Views/DashboardView.swift

@@ -84,7 +84,7 @@ final class DashboardView: NSView {
84 84
         chromeContainer.translatesAutoresizingMaskIntoConstraints = false
85 85
         chromeContainer.wantsLayer = true
86 86
         chromeContainer.layer?.backgroundColor = Theme.chromeBackground.cgColor
87
-        chromeContainer.layer?.cornerRadius = 18
87
+        chromeContainer.layer?.cornerRadius = 0
88 88
         documentContainer.addSubview(chromeContainer)
89 89
         chromeContainer.addSubview(contentStack)
90 90
         scrollView.documentView = documentContainer
@@ -163,11 +163,10 @@ final class DashboardView: NSView {
163 163
             scrollView.topAnchor.constraint(equalTo: topAnchor),
164 164
             scrollView.bottomAnchor.constraint(equalTo: bottomAnchor),
165 165
 
166
-            chromeContainer.topAnchor.constraint(equalTo: documentContainer.topAnchor, constant: 18),
167
-            chromeContainer.bottomAnchor.constraint(equalTo: documentContainer.bottomAnchor, constant: -18),
168
-            chromeContainer.centerXAnchor.constraint(equalTo: documentContainer.centerXAnchor),
169
-            chromeContainer.widthAnchor.constraint(lessThanOrEqualToConstant: 1240),
170
-            chromeContainer.widthAnchor.constraint(equalTo: documentContainer.widthAnchor, constant: -36),
166
+            chromeContainer.leadingAnchor.constraint(equalTo: documentContainer.leadingAnchor),
167
+            chromeContainer.trailingAnchor.constraint(equalTo: documentContainer.trailingAnchor),
168
+            chromeContainer.topAnchor.constraint(equalTo: documentContainer.topAnchor),
169
+            chromeContainer.bottomAnchor.constraint(equalTo: documentContainer.bottomAnchor),
171 170
 
172 171
             contentStack.leadingAnchor.constraint(equalTo: chromeContainer.leadingAnchor),
173 172
             contentStack.trailingAnchor.constraint(equalTo: chromeContainer.trailingAnchor),
@@ -333,7 +332,7 @@ final class DashboardView: NSView {
333 332
 
334 333
     private func updateDocumentLayout() {
335 334
         documentContainer.layoutSubtreeIfNeeded()
336
-        let fittingHeight = max(chromeContainer.fittingSize.height + 36, bounds.height)
335
+        let fittingHeight = max(chromeContainer.fittingSize.height, bounds.height)
337 336
         documentContainer.frame = NSRect(x: 0, y: 0, width: bounds.width, height: fittingHeight)
338 337
     }
339 338
 }