From 6523d49b446139a1ec1e2134a2ea980765b7c66a Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Mon, 22 Jul 2024 01:36:14 +0200 Subject: Create a keyboard shortcut to close the main window. --- src/gui/window.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/window.c b/src/gui/window.c index dcdd4d1..24716ed 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -79,6 +79,9 @@ static void gtk_framework_window_class_init(GtkFrameworkWindowClass *class) gtk_widget_class_bind_template_child(widget, GtkFrameworkWindow, grid); + /* Active une action native (cf. https://docs.gtk.org/gtk4/class.Window.html#actions) */ + gtk_widget_class_add_binding_action(widget, GDK_KEY_Q, GDK_CONTROL_MASK, "window.close", NULL); + } -- cgit v0.11.2-87-g4458