diff options
author | Cody Russell <crussell@canonical.com> | 2010-01-07 09:27:01 -0600 |
---|---|---|
committer | Cody Russell <crussell@canonical.com> | 2010-01-07 09:27:01 -0600 |
commit | bf0be373898c44e6e9898aeac5813704fca7889e (patch) | |
tree | b7416d03a9e932ce5147742beafec6539745177c | |
parent | dd2ed951b8aeb16671bebd2ea104953252ab54a5 (diff) | |
download | libayatana-appindicator-bf0be373898c44e6e9898aeac5813704fca7889e.tar.gz libayatana-appindicator-bf0be373898c44e6e9898aeac5813704fca7889e.tar.bz2 libayatana-appindicator-bf0be373898c44e6e9898aeac5813704fca7889e.zip |
Checkmark support
-rw-r--r-- | example/simple-client.c | 2 | ||||
-rw-r--r-- | src/libappindicator/app-indicator.c | 18 |
2 files changed, 17 insertions, 3 deletions
diff --git a/example/simple-client.c b/example/simple-client.c index ea4da9d..850ef18 100644 --- a/example/simple-client.c +++ b/example/simple-client.c @@ -58,7 +58,7 @@ main (int argc, char ** argv) G_CALLBACK (item_clicked_cb), "1"); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - item = gtk_menu_item_new_with_label ("2"); + item = gtk_check_menu_item_new_with_label ("2"); g_signal_connect (item, "activate", G_CALLBACK (item_clicked_cb), "2"); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index bb68cb2..8e03e07 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -686,15 +686,29 @@ container_iterate (GtkWidget *widget, if (GTK_IS_SEPARATOR_MENU_ITEM (widget)) { + label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + dbusmenu_menuitem_property_set (child, "type", DBUSMENU_CLIENT_TYPES_SEPARATOR); } else { - label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + if (GTK_IS_CHECK_MENU_ITEM (widget)) + { + label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + + dbusmenu_menuitem_property_set (child, + "type", + DBUSMENU_MENUITEM_TOGGLE_CHECK); - if (GTK_IS_IMAGE_MENU_ITEM (widget)) + dbusmenu_menuitem_property_set (child, + DBUSMENU_MENUITEM_PROP_LABEL, + label); + + label_set = TRUE; + } + else if (GTK_IS_IMAGE_MENU_ITEM (widget)) { GtkWidget *image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (widget)); |