ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #01691
[Merge] lp:~bratsche/appmenu-gtk/accelerators into lp:appmenu-gtk
Cody Russell has proposed merging lp:~bratsche/appmenu-gtk/accelerators into lp:appmenu-gtk.
Requested reviews:
Canonical Desktop Experience Team (canonical-dx-team)
Related bugs:
#591293 Add support for keyboard shortcuts in menus
https://bugs.launchpad.net/bugs/591293
--
https://code.launchpad.net/~bratsche/appmenu-gtk/accelerators/+merge/28205
Your team ayatana-commits is subscribed to branch lp:appmenu-gtk.
=== modified file 'src/bridge.c'
--- src/bridge.c 2010-06-22 13:12:20 +0000
+++ src/bridge.c 2010-06-22 16:08:26 +0000
@@ -31,6 +31,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
+#include <libdbusmenu-gtk/menuitem.h>
#include <libdbusmenu-glib/menuitem.h>
#include <libdbusmenu-glib/server.h>
@@ -404,6 +405,14 @@
gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)) ? DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED : DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED);
}
+static void
+accel_changed (GtkWidget *widget,
+ gpointer data)
+{
+ DbusmenuMenuitem *mi = (DbusmenuMenuitem *)data;
+ dbusmenu_menuitem_property_set_shortcut_menuitem (mi, GTK_MENU_ITEM (widget));
+}
+
static DbusmenuMenuitem *
construct_dbusmenu_for_widget (GtkWidget *widget)
{
@@ -419,6 +428,11 @@
}
else
{
+ g_signal_connect (widget,
+ "accel-closures-changed",
+ G_CALLBACK (accel_changed),
+ mi);
+
if (GTK_IS_CHECK_MENU_ITEM (widget))
{
dbusmenu_menuitem_property_set (mi,
@@ -447,6 +461,8 @@
DBUSMENU_MENUITEM_PROP_ENABLED,
gtk_widget_get_sensitive (widget));
+ dbusmenu_menuitem_property_set_shortcut_menuitem (mi, GTK_MENU_ITEM (widget));
+
g_signal_connect (G_OBJECT (widget),
"notify",
G_CALLBACK (widget_notify_cb),
Follow ups