mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-06-01 04:58:37 +03:00
macos: comment the new views
This commit is contained in:
@ -3,6 +3,8 @@ import Cocoa
|
||||
import SwiftUI
|
||||
import GhosttyKit
|
||||
|
||||
/// This initializes an "unsafe paste" warning window. The window itself WILL NOT show automatically
|
||||
/// and the caller must show the window via showWindow, beginSheet, etc.
|
||||
class PasteProtectionController: NSWindowController {
|
||||
override var windowNibName: NSNib.Name? { "PasteProtection" }
|
||||
|
||||
|
@ -1,16 +1,21 @@
|
||||
import SwiftUI
|
||||
|
||||
/// This delegate is notified of the completion result of the paste protection dialog.
|
||||
protocol PasteProtectionViewDelegate: AnyObject {
|
||||
func pasteProtectionComplete(_ action: PasteProtectionView.Action)
|
||||
}
|
||||
|
||||
/// The SwiftUI view for showing a paste protection dialog.
|
||||
struct PasteProtectionView: View {
|
||||
enum Action : String {
|
||||
case cancel
|
||||
case paste
|
||||
}
|
||||
|
||||
/// The contents of the paste.
|
||||
let contents: String
|
||||
|
||||
/// Optional delegate to get results. If this is nil, then this view will never close on its own.
|
||||
weak var delegate: PasteProtectionViewDelegate? = nil
|
||||
|
||||
var body: some View {
|
||||
|
Reference in New Issue
Block a user