Преглед изворни кода

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 пре 2 месеци
родитељ
комит
738c248172
1 измењених фајлова са 3 додато и 0 уклоњено
  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 {
 
 
         contentStack.orientation = .horizontal
         contentStack.orientation = .horizontal
         contentStack.spacing = 20
         contentStack.spacing = 20
+        contentStack.distribution = .fill
         contentStack.translatesAutoresizingMaskIntoConstraints = false
         contentStack.translatesAutoresizingMaskIntoConstraints = false
         contentStack.alignment = .height
         contentStack.alignment = .height
         contentStack.edgeInsets = NSEdgeInsets(top: 24, left: 24, bottom: 24, right: 24)
         contentStack.edgeInsets = NSEdgeInsets(top: 24, left: 24, bottom: 24, right: 24)
@@ -107,6 +108,8 @@ final class DashboardView: NSView {
         mainHost.layer?.backgroundColor = Theme.mainHostBackground.cgColor
         mainHost.layer?.backgroundColor = Theme.mainHostBackground.cgColor
         mainHost.layer?.cornerRadius = 16
         mainHost.layer?.cornerRadius = 16
         mainHost.layer?.masksToBounds = true
         mainHost.layer?.masksToBounds = true
+        sidebar.setContentHuggingPriority(.required, for: .horizontal)
+        mainHost.setContentHuggingPriority(.defaultLow, for: .horizontal)
 
 
         mainHost.addSubview(mainOverlay)
         mainHost.addSubview(mainOverlay)