From 20575b928f9395f8fceb3890d1ccc92918811227 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 5 Dec 2014 17:22:03 -0200 Subject: [PATCH] edit-dialog: update source color on selection --- src/gcal-edit-dialog.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c index 0969c1be..39037862 100644 --- a/src/gcal-edit-dialog.c +++ b/src/gcal-edit-dialog.c @@ -185,6 +185,16 @@ on_calendar_selected (GtkWidget *menu_item, if (g_strcmp0 (e_source_get_uid (source), uid) == 0) { + GdkRGBA color; + ESourceSelectable *extension; + + /* retrieve color */ + extension = E_SOURCE_SELECTABLE (e_source_get_extension (source, E_SOURCE_EXTENSION_CALENDAR)); + gdk_rgba_parse (&color, e_source_selectable_get_color (E_SOURCE_SELECTABLE (extension))); + + gtk_image_set_from_pixbuf (GTK_IMAGE (priv->source_image), + gcal_get_pixbuf_from_color (&color, 16)); + priv->source = source; gtk_header_bar_set_subtitle (GTK_HEADER_BAR (priv->titlebar), e_source_get_display_name (priv->source));