Ver código fonte

Fix dashboard main panel not expanding with window width.

Set horizontal content hugging so the sidebar keeps fixed width and
mainHost absorbs extra space. Set content stack distribution to fill.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 3 semanas atrás
pai
commit
738c248172
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      App for Indeed/Views/DashboardView.swift

+ 3 - 0
App for Indeed/Views/DashboardView.swift

@@ -77,6 +77,7 @@ final class DashboardView: NSView {
77
 
77
 
78
         contentStack.orientation = .horizontal
78
         contentStack.orientation = .horizontal
79
         contentStack.spacing = 20
79
         contentStack.spacing = 20
80
+        contentStack.distribution = .fill
80
         contentStack.translatesAutoresizingMaskIntoConstraints = false
81
         contentStack.translatesAutoresizingMaskIntoConstraints = false
81
         contentStack.alignment = .height
82
         contentStack.alignment = .height
82
         contentStack.edgeInsets = NSEdgeInsets(top: 24, left: 24, bottom: 24, right: 24)
83
         contentStack.edgeInsets = NSEdgeInsets(top: 24, left: 24, bottom: 24, right: 24)
@@ -107,6 +108,8 @@ final class DashboardView: NSView {
107
         mainHost.layer?.backgroundColor = Theme.mainHostBackground.cgColor
108
         mainHost.layer?.backgroundColor = Theme.mainHostBackground.cgColor
108
         mainHost.layer?.cornerRadius = 16
109
         mainHost.layer?.cornerRadius = 16
109
         mainHost.layer?.masksToBounds = true
110
         mainHost.layer?.masksToBounds = true
111
+        sidebar.setContentHuggingPriority(.required, for: .horizontal)
112
+        mainHost.setContentHuggingPriority(.defaultLow, for: .horizontal)
110
 
113
 
111
         mainHost.addSubview(mainOverlay)
114
         mainHost.addSubview(mainOverlay)
112
 
115