forked from AuroraMiddleware/gtk
modelmenu: set the accel group on the GtkMenu
Or the accelerators added for actions in the menu won't be displayed in the menu items. https://bugzilla.gnome.org/show_bug.cgi?id=679166
This commit is contained in:
parent
598163e526
commit
06c8739de4
@ -267,6 +267,7 @@ gtk_model_menu_create_menu (GMenuModel *model,
|
||||
GtkWidget *menu;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
gtk_menu_set_accel_group (GTK_MENU (menu), accels);
|
||||
|
||||
gtk_model_menu_bind (GTK_MENU_SHELL (menu), model, TRUE);
|
||||
gtk_model_menu_populate (GTK_MENU_SHELL (menu), actions, accels);
|
||||
@ -291,6 +292,7 @@ notify_attach (GtkMenu *menu,
|
||||
actions = gtk_application_window_get_observable (GTK_APPLICATION_WINDOW (toplevel));
|
||||
accels = gtk_application_window_get_accel_group (GTK_APPLICATION_WINDOW (toplevel));
|
||||
|
||||
gtk_menu_set_accel_group (menu, accels);
|
||||
gtk_model_menu_populate (GTK_MENU_SHELL (menu), actions, accels);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user