mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 15:38:35 +00:00
macos: comment the new views
This commit is contained in:
@@ -3,6 +3,8 @@ import Cocoa
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
import GhosttyKit
|
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 {
|
class PasteProtectionController: NSWindowController {
|
||||||
override var windowNibName: NSNib.Name? { "PasteProtection" }
|
override var windowNibName: NSNib.Name? { "PasteProtection" }
|
||||||
|
|
||||||
|
@@ -1,16 +1,21 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
/// This delegate is notified of the completion result of the paste protection dialog.
|
||||||
protocol PasteProtectionViewDelegate: AnyObject {
|
protocol PasteProtectionViewDelegate: AnyObject {
|
||||||
func pasteProtectionComplete(_ action: PasteProtectionView.Action)
|
func pasteProtectionComplete(_ action: PasteProtectionView.Action)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The SwiftUI view for showing a paste protection dialog.
|
||||||
struct PasteProtectionView: View {
|
struct PasteProtectionView: View {
|
||||||
enum Action : String {
|
enum Action : String {
|
||||||
case cancel
|
case cancel
|
||||||
case paste
|
case paste
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The contents of the paste.
|
||||||
let contents: String
|
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
|
weak var delegate: PasteProtectionViewDelegate? = nil
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
Reference in New Issue
Block a user