From 22a6fdb518be4189a13f4d8a7f0b07122cc87cdd Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Fri, 28 Sep 2012 17:01:02 +0200 Subject: Include fallback icon names And use g_icon_new_from_string in the indicator to make it load fallbacks. --- src/indicator-messages.c | 15 ++++++++++++--- src/messages-service.c | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/indicator-messages.c b/src/indicator-messages.c index 13b3409..5c5df31 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -340,11 +340,20 @@ static void indicator_messages_update_icon (IndicatorMessages *self, GVariant *state) { + GIcon *icon; + GError *error = NULL; + g_return_if_fail (g_variant_is_of_type (state, G_VARIANT_TYPE_STRING)); - gtk_image_set_from_icon_name (GTK_IMAGE (self->image), - g_variant_get_string (state, NULL), - GTK_ICON_SIZE_LARGE_TOOLBAR); + icon = g_icon_new_for_string (g_variant_get_string (state, NULL), &error); + if (icon == NULL) { + g_warning ("unable to load icon: %s", error->message); + g_error_free (error); + } + else { + gtk_image_set_from_gicon (GTK_IMAGE (self->image), icon, GTK_ICON_SIZE_LARGE_TOOLBAR); + g_object_unref (icon); + } } static void diff --git a/src/messages-service.c b/src/messages-service.c index 73f3d35..b36a0a2 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -70,6 +70,10 @@ indicator_messages_get_icon_name () g_string_append (name, "-new"); icon = g_themed_icon_new (name->str); + g_themed_icon_append_name (G_THEMED_ICON (icon), + draws_attention ? "indicator-messages-new" + : "indicator-messages"); + iconstr = g_icon_to_string (icon); g_object_unref (icon); -- cgit v1.2.3