[gtk+] Make GtkEntryCompletion use GtkStyleContext



commit e02cbf477015f9046bdc13ed8e2a0c99610223c6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jan 4 02:31:06 2011 +0100

    Make GtkEntryCompletion use GtkStyleContext

 gtk/gtkentrycompletion.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 0808c10..1226723 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -1510,6 +1510,8 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion,
                              GdkDevice          *device)
 {
   GtkTreeViewColumn *column;
+  GtkStyleContext *context;
+  GdkRGBA color;
   GList *renderers;
   GtkWidget *toplevel;
 
@@ -1529,9 +1531,12 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion,
     
   column = gtk_tree_view_get_column (GTK_TREE_VIEW (completion->priv->action_view), 0);
   renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
-  gtk_widget_ensure_style (completion->priv->tree_view);
-  g_object_set (GTK_CELL_RENDERER (renderers->data), "cell-background-gdk",
-                &gtk_widget_get_style (completion->priv->tree_view)->bg[GTK_STATE_NORMAL],
+
+  context = gtk_widget_get_style_context (completion->priv->tree_view);
+  gtk_style_context_get_background_color (context, 0, &color);
+
+  g_object_set (GTK_CELL_RENDERER (renderers->data),
+                "cell-background-rgba", &color,
                 NULL);
   g_list_free (renderers);
 



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