69 lines
1.4 KiB
Plaintext
69 lines
1.4 KiB
Plaintext
using Gtk 4.0;
|
|
using Adw 1;
|
|
|
|
template $GhosttySurface: Adw.Bin {
|
|
focusable: true;
|
|
// We need to wrap our Overlay one more time because if you bind a
|
|
// direct child of your widget to a property, it will double free:
|
|
// https://gitlab.gnome.org/GNOME/gtk/-/blob/847571a1e314aba79260e4ef282e2ed9ba91a0d9/gtk/gtkwidget.c#L11423-11425
|
|
Adw.Bin {
|
|
Overlay overlay {
|
|
focusable: false;
|
|
focus-on-click: false;
|
|
|
|
GLArea gl_area {
|
|
hexpand: true;
|
|
vexpand: true;
|
|
focusable: true;
|
|
focus-on-click: true;
|
|
}
|
|
|
|
[overlay]
|
|
$GhosttyResizeOverlay resize_overlay {
|
|
styles [
|
|
"size-overlay",
|
|
]
|
|
}
|
|
|
|
[overlay]
|
|
Label url_left {
|
|
styles [
|
|
"url-overlay",
|
|
]
|
|
|
|
visible: false;
|
|
halign: start;
|
|
valign: end;
|
|
label: bind template.mouse-hover-url;
|
|
|
|
EventControllerMotion url_ec_motion {}
|
|
}
|
|
|
|
[overlay]
|
|
Label url_right {
|
|
styles [
|
|
"url-overlay",
|
|
]
|
|
|
|
visible: false;
|
|
halign: end;
|
|
valign: end;
|
|
label: bind template.mouse-hover-url;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Event controllers for interactivity
|
|
EventControllerFocus ec_focus {}
|
|
|
|
EventControllerKey ec_key {}
|
|
|
|
EventControllerMotion ec_motion {}
|
|
|
|
EventControllerScroll ec_scroll {}
|
|
|
|
GestureClick gesture_click {
|
|
button: 0;
|
|
}
|
|
}
|