aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/client.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2010-04-01 12:26:57 +0200
committerSebastien Bacher <seb128@ubuntu.com>2010-04-01 12:26:57 +0200
commit0f343edd778547d86b08bc4550f29429715928f1 (patch)
tree242e55e124171715b77d7a1902b903b9b9710731 /libdbusmenu-gtk/client.c
parent7320945c0ee39070e261462f850829a8b3e87d73 (diff)
parent63a5d2daa865aa68b4ea152a92373e3c187e13af (diff)
downloadlibdbusmenu-0f343edd778547d86b08bc4550f29429715928f1.tar.gz
libdbusmenu-0f343edd778547d86b08bc4550f29429715928f1.tar.bz2
libdbusmenu-0f343edd778547d86b08bc4550f29429715928f1.zip
releasing version 0.2.8-0ubuntu1
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r--libdbusmenu-gtk/client.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index 781326e..98f1cb2 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,8 @@ 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) {
+ 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 +585,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;