Skip to content

Commit e2d52e1

Browse files
kengruvenp2
authored andcommitted
Give the Cancel button a more standard appearance and location (p2#246)
1 parent 09bd3e3 commit e2d52e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/macOS/OAuth2WebViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public class OAuth2WebViewController: NSViewController, WKNavigationDelegate, NS
127127

128128
view.addSubview(webView)
129129
view.addConstraint(NSLayoutConstraint(item: webView, attribute: .top, relatedBy: .equal, toItem: view, attribute: .top, multiplier: 1.0, constant: 0.0))
130-
view.addConstraint(NSLayoutConstraint(item: webView, attribute: .bottom, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1.0, constant: 0.0))
130+
view.addConstraint(NSLayoutConstraint(item: webView, attribute: .bottom, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1.0, constant: (willBecomeSheet ? -40.0 : 0.0)))
131131
view.addConstraint(NSLayoutConstraint(item: webView, attribute: .left, relatedBy: .equal, toItem: view, attribute: .left, multiplier: 1.0, constant: 0.0))
132132
view.addConstraint(NSLayoutConstraint(item: webView, attribute: .right, relatedBy: .equal, toItem: view, attribute: .right, multiplier: 1.0, constant: 0.0))
133133

@@ -136,6 +136,7 @@ public class OAuth2WebViewController: NSViewController, WKNavigationDelegate, NS
136136
let button = NSButton(frame: NSRect(x: 0, y: 0, width: 120, height: 20))
137137
button.translatesAutoresizingMaskIntoConstraints = false
138138
button.title = "Cancel"
139+
button.bezelStyle = .rounded
139140
button.target = self
140141
button.action = #selector(OAuth2WebViewController.cancel(_:))
141142
view.addSubview(button)

0 commit comments

Comments
 (0)