aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/client.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-31 13:51:48 -0500
committerTed Gould <ted@gould.cx>2010-03-31 13:51:48 -0500
commit0bec1d5af5d3d61ffc24913e0257f724765e5563 (patch)
treee6aaa5fd904fbb136625714c1643381b5baa26ce /libdbusmenu-gtk/client.c
parent79f8505edd8fd05373275f2835e2400d7611fcf5 (diff)
parent04ad3cb433ac8ed581998ea6ce69bd0e7d1dbb68 (diff)
downloadlibdbusmenu-0bec1d5af5d3d61ffc24913e0257f724765e5563.tar.gz
libdbusmenu-0bec1d5af5d3d61ffc24913e0257f724765e5563.tar.bz2
libdbusmenu-0bec1d5af5d3d61ffc24913e0257f724765e5563.zip
Bringing up to date with trunk
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 bef27dd..3de42fe 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -417,7 +417,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;
}
@@ -519,7 +518,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;
}
}
@@ -531,6 +530,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. */
@@ -590,6 +591,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;