[gtk+/treeview-style: 8/8] Make GtkCellRendererAccel use GtkStyleContext



commit 3e5261d29274ed1519d651b35bb57eb11ded49df
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jan 12 21:29:41 2011 +0100

    Make GtkCellRendererAccel use GtkStyleContext

 gtk/gtkcellrendereraccel.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index cbd4b35..d26a7ce 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -585,7 +585,8 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer      *cell,
   GtkCellRendererAccelPrivate *priv;
   GtkCellRendererText *celltext;
   GtkCellRendererAccel *accel;
-  GtkStyle *style;
+  GtkStyleContext *context;
+  GdkRGBA color;
   GtkWidget *label;
   GtkWidget *eventbox;
   GdkDevice *device, *keyb, *pointer;
@@ -603,7 +604,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer      *cell,
     return NULL;
 
   window = gtk_widget_get_window (widget);
-  style = gtk_widget_get_style (widget);
+  context = gtk_widget_get_style_context (widget);
 
   g_return_val_if_fail (window != NULL, NULL);
 
@@ -659,13 +660,11 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer      *cell,
   label = gtk_label_new (NULL);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 
-  
-
-  gtk_widget_modify_bg (eventbox, GTK_STATE_NORMAL,
-                        &style->bg[GTK_STATE_SELECTED]);
+  gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &color);
+  gtk_widget_override_background_color (label, 0, &color);
 
-  gtk_widget_modify_fg (label, GTK_STATE_NORMAL,
-                        &style->fg[GTK_STATE_SELECTED]);
+  gtk_style_context_get_color (context, GTK_STATE_FLAG_SELECTED, &color);
+  gtk_widget_override_color (label, 0, &color);
 
   /* This label is displayed in a treeview cell displaying
    * an accelerator when the cell is clicked to change the 



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