diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | libdbusmenu-gtk/client.c | 21 |
2 files changed, 27 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 51362d2..13b186e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libdbusmenu (0.2.0-0ubuntu2~ppa1~ltr1) UNRELEASED; urgency=low + + * Upstream update + * Adding in checking for icon name plus 'ltr' to see if + it exists. + + -- Ted Gould <ted@ubuntu.com> Mon, 11 Jan 2010 11:32:38 -0600 + libdbusmenu (0.2.0-0ubuntu1) lucid; urgency=low * Upstream release 0.2.0 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 { |