mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 15:38:35 +00:00
macos: hook up paste protection delegate, cancel button
This commit is contained in:
@@ -6,10 +6,24 @@ import GhosttyKit
|
||||
class PasteProtectionController: NSWindowController {
|
||||
override var windowNibName: NSNib.Name? { "PasteProtection" }
|
||||
|
||||
weak private var delegate: PasteProtectionViewDelegate? = nil
|
||||
|
||||
init(delegate: PasteProtectionViewDelegate) {
|
||||
self.delegate = delegate
|
||||
super.init(window: nil)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) is not supported for this view")
|
||||
}
|
||||
|
||||
//MARK: - NSWindowController
|
||||
|
||||
override func windowDidLoad() {
|
||||
guard let window = window else { return }
|
||||
window.contentView = NSHostingView(rootView: PasteProtectionView())
|
||||
window.contentView = NSHostingView(rootView: PasteProtectionView(
|
||||
contents: "Hello",
|
||||
delegate: delegate
|
||||
))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user