[empathy: 8/11] persona-view: use new GTK+ style API (#636500)



commit 30f5f6ea4a935eaa5d68f9d68998bee4b5d1bcbb
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Dec 15 14:55:29 2010 +0100

    persona-view: use new GTK+ style API (#636500)

 libempathy-gtk/empathy-persona-view.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/libempathy-gtk/empathy-persona-view.c b/libempathy-gtk/empathy-persona-view.c
index adfe6be..02a9ff5 100644
--- a/libempathy-gtk/empathy-persona-view.c
+++ b/libempathy-gtk/empathy-persona-view.c
@@ -236,29 +236,28 @@ cell_set_background (EmpathyPersonaView *self,
     GtkCellRenderer *cell,
     gboolean is_active)
 {
-  GdkColor  color;
-  GtkStyle *style;
-
-  style = gtk_widget_get_style (GTK_WIDGET (self));
-
   if (is_active)
     {
-      color = style->bg[GTK_STATE_SELECTED];
+      GdkRGBA color;
+      GtkStyleContext *style;
+
+      style = gtk_widget_get_style_context (GTK_WIDGET (self));
+
+      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);
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]