1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Add keyboard accelerators in the GtkApplication menu.

Now that they actually _work_, it seems more useful to start putting
them in on purpose.
This commit is contained in:
Simon Tatham 2017-12-18 11:01:42 +00:00
parent 1904c404ed
commit 31080bf8a7

View File

@ -118,6 +118,19 @@ static void startup(GApplication *app, gpointer user_data)
g_menu_append(section, "Copy", "win.copy");
g_menu_append(section, "Paste", "win.paste");
#define SET_ACCEL(app, command, accel) do \
{ \
static const char *const accels[] = { accel, NULL }; \
gtk_application_set_accels_for_action( \
GTK_APPLICATION(app), command, accels); \
} while (0)
SET_ACCEL(app, "app.newwin", "<Primary>n");
SET_ACCEL(app, "win.copy", "<Primary>c");
SET_ACCEL(app, "win.paste", "<Primary>v");
#undef SET_ACCEL
gtk_application_set_menubar(GTK_APPLICATION(app),
G_MENU_MODEL(menubar));
}