aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/apprt/gtk/ui/1.4/clipboard-confirmation-dialog.blp
blob: 144e3a3714a761089fc7cebf3d7285c5a826b41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using Gtk 4.0;
// This is unused but if we remove it we get a blueprint-compiler error.
using Adw 1;

template $GhosttyClipboardConfirmationDialog: $GhosttyDialog {
  styles [
    "clipboard-confirmation-dialog",
  ]

  notify::blur => $notify_blur();
  notify::request => $notify_request();
  heading: _("Authorize Clipboard Access");
  // Not localized because this is a placeholder users never see.
  body: "If you see this text, there is a bug in Ghostty. Please report it.";

  responses [
    cancel: _("Deny") suggested,
    ok: _("Allow") destructive,
  ]

  default-response: "cancel";
  close-response: "cancel";

  extra-child: ListBox {
    selection-mode: none;

    Overlay {
      styles [
        "osd",
        "clipboard-overlay",
      ]

      ScrolledWindow text_view_scroll {
        width-request: 500;
        height-request: 200;

        TextView text_view {
          styles [
            "clipboard-contents",
          ]

          cursor-visible: false;
          editable: false;
          monospace: true;
          top-margin: 8;
          left-margin: 8;
          bottom-margin: 8;
          right-margin: 8;
          buffer: bind template.clipboard-contents;
        }
      }

      [overlay]
      Button reveal_button {
        clicked => $reveal_clicked();
        visible: false;
        halign: end;
        valign: start;
        margin-end: 12;
        margin-top: 12;

        Image {
          icon-name: "view-reveal-symbolic";
        }
      }

      [overlay]
      Button hide_button {
        clicked => $hide_clicked();
        visible: false;
        halign: end;
        valign: start;
        margin-end: 12;
        margin-top: 12;

        styles [
          "opaque",
        ]

        Image {
          icon-name: "view-conceal-symbolic";
        }
      }
    }

    Adw.SwitchRow remember_choice {
      styles [
        "card",
      ]

      visible: bind template.can-remember;
      title: _("Remember choice for this split");
      subtitle: _("Reload configuration to show this prompt again");
    }
  };
}