|
@@ -319,6 +319,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
titleField.textColor = Theme.primaryText
|
|
titleField.textColor = Theme.primaryText
|
|
|
titleField.maximumNumberOfLines = 2
|
|
titleField.maximumNumberOfLines = 2
|
|
|
titleField.lineBreakMode = .byWordWrapping
|
|
titleField.lineBreakMode = .byWordWrapping
|
|
|
|
|
+ titleField.alignment = .left
|
|
|
titleField.translatesAutoresizingMaskIntoConstraints = false
|
|
titleField.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
|
|
let descriptionField = NSTextField(wrappingLabelWithString: job.description)
|
|
let descriptionField = NSTextField(wrappingLabelWithString: job.description)
|
|
@@ -376,14 +377,22 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
buttonRow.setContentHuggingPriority(.required, for: .horizontal)
|
|
buttonRow.setContentHuggingPriority(.required, for: .horizontal)
|
|
|
buttonRow.setContentCompressionResistancePriority(.required, for: .horizontal)
|
|
buttonRow.setContentCompressionResistancePriority(.required, for: .horizontal)
|
|
|
|
|
|
|
|
- titleField.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
|
|
|
|
|
|
+ // Title hugs the leading edge; a low–hugging-priority spacer absorbs remaining width so buttons stay trailing.
|
|
|
|
|
+ titleField.setContentHuggingPriority(.defaultHigh, for: .horizontal)
|
|
|
titleField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
|
titleField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
|
|
|
|
|
|
|
- let titleAndActionsRow = NSStackView(views: [titleField, buttonRow])
|
|
|
|
|
|
|
+ let titleRowSpacer = NSView()
|
|
|
|
|
+ titleRowSpacer.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
+ titleRowSpacer.setContentHuggingPriority(NSLayoutConstraint.Priority(1), for: .horizontal)
|
|
|
|
|
+ titleRowSpacer.setContentCompressionResistancePriority(NSLayoutConstraint.Priority(1), for: .horizontal)
|
|
|
|
|
+
|
|
|
|
|
+ let titleAndActionsRow = NSStackView(views: [titleField, titleRowSpacer, buttonRow])
|
|
|
titleAndActionsRow.orientation = .horizontal
|
|
titleAndActionsRow.orientation = .horizontal
|
|
|
- titleAndActionsRow.spacing = 14
|
|
|
|
|
|
|
+ titleAndActionsRow.spacing = 0
|
|
|
|
|
+ titleAndActionsRow.setCustomSpacing(14, after: titleRowSpacer)
|
|
|
titleAndActionsRow.alignment = .centerY
|
|
titleAndActionsRow.alignment = .centerY
|
|
|
titleAndActionsRow.distribution = .fill
|
|
titleAndActionsRow.distribution = .fill
|
|
|
|
|
+ titleAndActionsRow.userInterfaceLayoutDirection = .leftToRight
|
|
|
titleAndActionsRow.translatesAutoresizingMaskIntoConstraints = false
|
|
titleAndActionsRow.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
|
|
let contentColumn = NSStackView(views: [titleAndActionsRow, descriptionField])
|
|
let contentColumn = NSStackView(views: [titleAndActionsRow, descriptionField])
|