diff options
author | Ted Gould <ted@gould.cx> | 2010-03-24 11:16:10 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-24 11:16:10 -0500 |
commit | 65d63c20738bf5c3951527b24b524e611af229f9 (patch) | |
tree | 760b4541977f0743574b037b9fde472613c4a3f7 | |
parent | c34945d55b2b2b308be4f2f0e71c621f5792e2ba (diff) | |
parent | 61885859a612061a04e1791b30265aa5fafa7b27 (diff) | |
download | libdbusmenu-65d63c20738bf5c3951527b24b524e611af229f9.tar.gz libdbusmenu-65d63c20738bf5c3951527b24b524e611af229f9.tar.bz2 libdbusmenu-65d63c20738bf5c3951527b24b524e611af229f9.zip |
* Upstream Merge
* Adding support for blank icons
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.h | 2 | ||||
-rw-r--r-- | libdbusmenu-gtk/client.c | 17 | ||||
-rw-r--r-- | tests/test-gtk-label.json | 4 |
5 files changed, 27 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 68ec49f..3a8086d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libdbusmenu (0.2.7-0ubuntu2~ppa1) UNRELEASED; urgency=low + + * Upstream Merge + * Adding support for blank icons + + -- Ted Gould <ted@ubuntu.com> Wed, 24 Mar 2010 11:15:48 -0500 + libdbusmenu (0.2.7-0ubuntu1) lucid; urgency=low * Upstream release 0.2.7 diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index a2d2682..28d3134 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -459,7 +459,7 @@ take_children_signal (gpointer data, gpointer user_data) While the name sounds devious that's exactly what this function does. It takes the list of children from the @mi and clears the - internal list. The calling function is no in charge of the ref's + internal list. The calling function is now in charge of the ref's on the children it has taken. A lot of responsibility involved in taking children. diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 1382335..04fd911 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -66,6 +66,8 @@ G_BEGIN_DECLS #define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED 1 #define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN -1 +#define DBUSMENU_MENUITEM_ICON_NAME_BLANK "blank-icon" + /** DbusmenuMenuitem: diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 781326e..e79d088 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -411,7 +411,6 @@ dbusmenu_gtkclient_menuitem_get (DbusmenuGtkClient * client, DbusmenuMenuitem * gpointer data = g_object_get_data(G_OBJECT(item), data_menuitem); if (data == NULL) { - g_warning("GTK not updated"); return NULL; } @@ -513,7 +512,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_DATA)) { /* If we have an image already built from a name that is way better than a pixbuf. Keep it. */ - if (gtkimage != NULL && gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_ICON_NAME) { + if (gtkimage != NULL && (gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_ICON_NAME || gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_EMPTY)) { return; } } @@ -525,6 +524,12 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV /* If there is no name, by golly we want no icon either. */ gtkimage = NULL; + } else if (g_strcmp0(iconname, DBUSMENU_MENUITEM_ICON_NAME_BLANK) == 0) { + if (gtkimage != NULL) { + g_object_unref(gtkimage); + } + + gtkimage = gtk_image_new(); } else { /* Look to see if we want to have an icon with the 'ltr' or 'rtl' depending on what we're doing. */ @@ -584,6 +589,14 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV } + if (gtkimage != NULL) { + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + + gtk_widget_set_size_request(GTK_WIDGET(gtkimage), width, height); + gtk_misc_set_alignment(GTK_MISC(gtkimage), 0.0, 0.5); + } + genericmenuitem_set_image(GENERICMENUITEM(gimi), gtkimage); return; diff --git a/tests/test-gtk-label.json b/tests/test-gtk-label.json index 973ab7b..755bd44 100644 --- a/tests/test-gtk-label.json +++ b/tests/test-gtk-label.json @@ -242,8 +242,8 @@ "label": "sad"}, {"id": 89, "type": "standard", - "icon-name": "face-sick", - "label": "sick"} + "icon-name": "blank-icon", + "label": "blank"} ] }, {"id": 9, "type": "standard", |