use MetaAccelLabel to display accelerators for the menu items

2002-09-26  Havoc Pennington  <hp@pobox.com>

	* src/menu.c (meta_window_menu_new): use MetaAccelLabel to display
	accelerators for the menu items

	* src/metaaccellabel.c: cut-and-paste GtkAccelLabel and port to
	use virtual modifiers

	* src/Makefile.am (metacity_SOURCES): add metaaccellabel.[hc]

	* src/prefs.c (meta_prefs_get_window_binding): new function

	* src/core.c (meta_core_get_menu_accelerator): new function
This commit is contained in:
Havoc Pennington
2002-09-27 01:40:17 +00:00
committed by Havoc Pennington
parent e608366a8e
commit 47f67eb270
9 changed files with 729 additions and 5 deletions

View File

@ -1188,3 +1188,25 @@ meta_prefs_get_keybinding_action (const char *name)
return META_KEYBINDING_ACTION_NONE;
}
void
meta_prefs_get_window_binding (const char *name,
unsigned int *keysym,
MetaVirtualModifier *modifiers)
{
int i;
i = G_N_ELEMENTS (window_bindings) - 2; /* -2 for dummy entry at end */
while (i >= 0)
{
if (strcmp (window_bindings[i].name, name) == 0)
{
*keysym = window_bindings[i].keysym;
*modifiers = window_bindings[i].modifiers;
return;
}
--i;
}
g_assert_not_reached ();
}