mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:40:44 +00:00
fix(macos): reserve exec approval dialog layout space (#75470)
Merged via squash.
Prepared head SHA: 8a3ca92150
Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com>
Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com>
Reviewed-by: @ngutman
This commit is contained in:
@@ -253,12 +253,11 @@ enum ExecApprovalsPromptPresenter {
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private static func buildAccessoryView(_ request: ExecApprovalPromptRequest) -> NSView {
|
||||
static func buildAccessoryView(_ request: ExecApprovalPromptRequest) -> NSView {
|
||||
let stack = NSStackView()
|
||||
stack.orientation = .vertical
|
||||
stack.spacing = 8
|
||||
stack.alignment = .leading
|
||||
stack.translatesAutoresizingMaskIntoConstraints = false
|
||||
stack.widthAnchor.constraint(greaterThanOrEqualToConstant: 380).isActive = true
|
||||
|
||||
let commandTitle = NSTextField(labelWithString: "Command")
|
||||
@@ -337,6 +336,10 @@ enum ExecApprovalsPromptPresenter {
|
||||
footer.font = NSFont.systemFont(ofSize: NSFont.smallSystemFontSize)
|
||||
stack.addArrangedSubview(footer)
|
||||
|
||||
// NSAlert reserves accessory space from the view frame, not from Auto Layout constraints.
|
||||
// Give the top-level accessory an explicit frame so its subviews do not paint over the
|
||||
// alert title, message, and buttons while the frame remains zero-sized.
|
||||
stack.frame = NSRect(origin: .zero, size: stack.fittingSize)
|
||||
return stack
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user