macOS: Manage tunnels: Add a box around the detail view
This commit is contained in:
parent
5ed147aa3e
commit
f26f4b5e7d
|
@ -63,6 +63,13 @@ class TunnelDetailTableViewController: NSViewController {
|
|||
return button
|
||||
}()
|
||||
|
||||
let box: NSBox = {
|
||||
let box = NSBox()
|
||||
box.titlePosition = .noTitle
|
||||
box.fillColor = .unemphasizedSelectedContentBackgroundColor
|
||||
return box
|
||||
}()
|
||||
|
||||
let tunnelsManager: TunnelsManager
|
||||
let tunnel: TunnelContainer
|
||||
var tunnelViewModel: TunnelViewModel {
|
||||
|
@ -111,9 +118,11 @@ class TunnelDetailTableViewController: NSViewController {
|
|||
let containerView = NSView()
|
||||
let bottomControlsContainer = NSLayoutGuide()
|
||||
containerView.addLayoutGuide(bottomControlsContainer)
|
||||
containerView.addSubview(box)
|
||||
containerView.addSubview(scrollView)
|
||||
containerView.addSubview(statusCheckbox)
|
||||
containerView.addSubview(editButton)
|
||||
box.translatesAutoresizingMaskIntoConstraints = false
|
||||
scrollView.translatesAutoresizingMaskIntoConstraints = false
|
||||
statusCheckbox.translatesAutoresizingMaskIntoConstraints = false
|
||||
editButton.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
@ -133,6 +142,13 @@ class TunnelDetailTableViewController: NSViewController {
|
|||
editButton.centerYAnchor.constraint(equalTo: bottomControlsContainer.centerYAnchor)
|
||||
])
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
scrollView.topAnchor.constraint(equalTo: box.topAnchor),
|
||||
scrollView.bottomAnchor.constraint(equalTo: box.bottomAnchor),
|
||||
scrollView.leadingAnchor.constraint(equalTo: box.leadingAnchor),
|
||||
scrollView.trailingAnchor.constraint(equalTo: box.trailingAnchor)
|
||||
])
|
||||
|
||||
view = containerView
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue