浏览代码

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 周之前
父节点
当前提交
6a7062e6a7
共有 1 个文件被更改,包括 6 次插入7 次删除
  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
         chromeContainer.translatesAutoresizingMaskIntoConstraints = false
84
         chromeContainer.translatesAutoresizingMaskIntoConstraints = false
85
         chromeContainer.wantsLayer = true
85
         chromeContainer.wantsLayer = true
86
         chromeContainer.layer?.backgroundColor = Theme.chromeBackground.cgColor
86
         chromeContainer.layer?.backgroundColor = Theme.chromeBackground.cgColor
87
-        chromeContainer.layer?.cornerRadius = 18
87
+        chromeContainer.layer?.cornerRadius = 0
88
         documentContainer.addSubview(chromeContainer)
88
         documentContainer.addSubview(chromeContainer)
89
         chromeContainer.addSubview(contentStack)
89
         chromeContainer.addSubview(contentStack)
90
         scrollView.documentView = documentContainer
90
         scrollView.documentView = documentContainer
@@ -163,11 +163,10 @@ final class DashboardView: NSView {
163
             scrollView.topAnchor.constraint(equalTo: topAnchor),
163
             scrollView.topAnchor.constraint(equalTo: topAnchor),
164
             scrollView.bottomAnchor.constraint(equalTo: bottomAnchor),
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
             contentStack.leadingAnchor.constraint(equalTo: chromeContainer.leadingAnchor),
171
             contentStack.leadingAnchor.constraint(equalTo: chromeContainer.leadingAnchor),
173
             contentStack.trailingAnchor.constraint(equalTo: chromeContainer.trailingAnchor),
172
             contentStack.trailingAnchor.constraint(equalTo: chromeContainer.trailingAnchor),
@@ -333,7 +332,7 @@ final class DashboardView: NSView {
333
 
332
 
334
     private func updateDocumentLayout() {
333
     private func updateDocumentLayout() {
335
         documentContainer.layoutSubtreeIfNeeded()
334
         documentContainer.layoutSubtreeIfNeeded()
336
-        let fittingHeight = max(chromeContainer.fittingSize.height + 36, bounds.height)
335
+        let fittingHeight = max(chromeContainer.fittingSize.height, bounds.height)
337
         documentContainer.frame = NSRect(x: 0, y: 0, width: bounds.width, height: fittingHeight)
336
         documentContainer.frame = NSRect(x: 0, y: 0, width: bounds.width, height: fittingHeight)
338
     }
337
     }
339
 }
338
 }