diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-12-15 21:53:11 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-12-15 23:47:25 +0800 |
commit | 4b9243dc87b1e8659c3349d54c0f86b77c677876 (patch) | |
tree | 6c4842c025cc329bb333f9e297cdbc7263051840 /libempathy-gtk/empathy-individual-view.c | |
parent | f77a1b3b6b3ffa4b47cf2e3cfab2f25f8383a3c1 (diff) | |
download | gsoc2013-empathy-4b9243dc87b1e8659c3349d54c0f86b77c677876.tar gsoc2013-empathy-4b9243dc87b1e8659c3349d54c0f86b77c677876.tar.gz gsoc2013-empathy-4b9243dc87b1e8659c3349d54c0f86b77c677876.tar.bz2 gsoc2013-empathy-4b9243dc87b1e8659c3349d54c0f86b77c677876.tar.lz gsoc2013-empathy-4b9243dc87b1e8659c3349d54c0f86b77c677876.tar.xz gsoc2013-empathy-4b9243dc87b1e8659c3349d54c0f86b77c677876.tar.zst gsoc2013-empathy-4b9243dc87b1e8659c3349d54c0f86b77c677876.zip |
individual-view: use new GTK+ style API (#636500)
Diffstat (limited to 'libempathy-gtk/empathy-individual-view.c')
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 30098e534..38ef61e54 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1047,28 +1047,27 @@ individual_view_cell_set_background (EmpathyIndividualView *view, gboolean is_group, gboolean is_active) { - GdkColor color; - GtkStyle *style; - - style = gtk_widget_get_style (GTK_WIDGET (view)); - if (!is_group && is_active) { - color = style->bg[GTK_STATE_SELECTED]; + GtkStyleContext *style; + GdkRGBA color; + + style = gtk_widget_get_style_context (GTK_WIDGET (view)); + + gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED, + &color); /* Here we take the current theme colour and add it to * the colour for white and average the two. This * gives a colour which is inline with the theme but * slightly whiter. */ - color.red = (color.red + (style->white).red) / 2; - color.green = (color.green + (style->white).green) / 2; - color.blue = (color.blue + (style->white).blue) / 2; + empathy_make_color_whiter (&color); - g_object_set (cell, "cell-background-gdk", &color, NULL); + g_object_set (cell, "cell-background-rgba", &color, NULL); } else - g_object_set (cell, "cell-background-gdk", NULL, NULL); + g_object_set (cell, "cell-background-rgba", NULL, NULL); } static void |