diff options
author | Ted Gould <ted@gould.cx> | 2010-01-11 11:33:15 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-01-11 11:33:15 -0600 |
commit | e5352dc063ad9c388b42eb98d23baaf81931fd6e (patch) | |
tree | c56ca41e7c2e6b9a1df5b5e409117e256458e63e /libdbusmenu-gtk/client.c | |
parent | 80fae17d718ff3af5b7ddddee850042d8d83d1f0 (diff) | |
parent | a9e8173a206f81967c099c2985253939f7445978 (diff) | |
download | libdbusmenu-e5352dc063ad9c388b42eb98d23baaf81931fd6e.tar.gz libdbusmenu-e5352dc063ad9c388b42eb98d23baaf81931fd6e.tar.bz2 libdbusmenu-e5352dc063ad9c388b42eb98d23baaf81931fd6e.zip |
* Upstream update
* Adding in checking for icon name plus 'ltr' to see if
it exists.
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r-- | libdbusmenu-gtk/client.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 4a8637a..319083c 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -511,13 +511,30 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV icon either. */ gtkimage = NULL; } else { + /* Look to see if we want to have an icon with the 'ltr' or + 'rtl' depending on what we're doing. */ + gchar * finaliconname = g_strdup_printf("%s-%s", iconname, "ltr"); + if (!gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), finaliconname)) { + /* If we don't have that icon, fall back to having one + without the extra bits. */ + g_free(finaliconname); + finaliconname = (gchar *)iconname; /* Dropping const not + becaue we don't love it. */ + } + /* If we don't have an image, we need to build one so that we can set the name. Otherwise we can just convert it to this name. */ if (gtkimage == NULL) { - gtkimage = gtk_image_new_from_icon_name(iconname, GTK_ICON_SIZE_MENU); + gtkimage = gtk_image_new_from_icon_name(finaliconname, GTK_ICON_SIZE_MENU); } else { - gtk_image_set_from_icon_name(GTK_IMAGE(gtkimage), iconname, GTK_ICON_SIZE_MENU); + gtk_image_set_from_icon_name(GTK_IMAGE(gtkimage), finaliconname, GTK_ICON_SIZE_MENU); + } + + /* If we're using the name with extra bits, then we need + to free that string. */ + if (finaliconname != iconname) { + g_free(finaliconname); } } } else { |