GNOME Bugzilla – Bug 708908
GMenuItem: There is no G_MENU_ATTRIBUTE_ACCEL
Last modified: 2014-04-01 11:06:45 UTC
I can specify an accelerator for a GMenuItem by doing: g_menu_item_set_attribute (menuitem, "accel", "<Primary>v"); Surely there should be a #define for this "standard attribute name", like the existing ones: https://developer.gnome.org/gio/unstable/GMenuModel.html#G-MENU-ATTRIBUTE-LABEL:CAPS
The eventual goal is to move away from directly specifying accels in menus, so I'd rather not add this now... Essentially, hardcoding an accel into a menuitem will prevent runtime dynamic changing of accels, which is a feature (as it turns out) that many people still want. See this branch (hopefully landing soon) for more info about how this will work: https://git.gnome.org/browse/gtk+/log/?h=wip/action-descriptions
OK, thanks, so then we would always call something like gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>l", "win.justify", g_variant_new_string ("left")); in code for every accelerator as in that branch's bloatpad.c? It would still be nice to specify the initial default accelerator in the XML.
There is going to be a new XML format for "action descriptions". The default accels will be there. This work will land this cycle.
(In reply to comment #3) > There is going to be a new XML format for "action descriptions". The default > accels will be there. This work will land this cycle. Did that happen?