[brasero] Fix 636499 - Port to the new gtk+ 3.0 GtkStyleContext



commit 35b91f09a7c086e480c479c2afcdf9aee65a4690
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon Dec 6 21:01:38 2010 +0100

    Fix 636499 - Port to the new gtk+ 3.0 GtkStyleContext

 src/baobab-cell-renderer-progress.c |   17 +++++------------
 src/brasero-project.c               |   10 ++++++++--
 2 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/src/baobab-cell-renderer-progress.c b/src/baobab-cell-renderer-progress.c
index abe2900..12fb344 100644
--- a/src/baobab-cell-renderer-progress.c
+++ b/src/baobab-cell-renderer-progress.c
@@ -102,7 +102,7 @@ baobab_cell_renderer_progress_set_property (GObject *object,
 static void
 baobab_cell_renderer_progress_get_size (GtkCellRenderer *cell,
 					GtkWidget       *widget,
-					GdkRectangle    *cell_area,
+					const GdkRectangle    *cell_area,
 					gint            *x_offset,
 					gint            *y_offset,
 					gint            *width,
@@ -191,7 +191,6 @@ baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
 				      GtkCellRendererState flags)
 {
   BaobabCellRendererProgress *cellprogress = BAOBAB_CELL_RENDERER_PROGRESS (cell);
-  GtkStyle *style;
   gint x, y, w, h, perc_w;
   gint xpad, ypad;
   gboolean is_rtl;
@@ -213,16 +212,6 @@ baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
    */
 
   cairo_rectangle (cr, x, y, w, h);
-  cairo_set_source_rgb (cr, 0, 0, 0);
-  cairo_fill (cr);
-
-  style = gtk_widget_get_style (widget);
-  x += style->xthickness;
-  y += style->ythickness;
-  w -= style->xthickness * 2;
-  h -= style->ythickness * 2;
-  
-  cairo_rectangle (cr, x, y, w, h);
   cairo_set_source_rgb (cr, 1, 1, 1);
   cairo_fill (cr);
 
@@ -231,6 +220,10 @@ baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
   cairo_rectangle (cr, is_rtl ? (x + w - perc_w) : x, y, perc_w, h);
   set_color_according_to_perc (cr, cellprogress->priv->perc);
   cairo_fill (cr);
+
+  cairo_rectangle (cr, x, y, w, h);
+  cairo_set_source_rgb (cr, 0, 0, 0);
+  cairo_fill (cr);
 }
 
 static void
diff --git a/src/brasero-project.c b/src/brasero-project.c
index af98604..ea54909 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -588,18 +588,24 @@ brasero_utils_disc_style_changed_cb (GtkWidget *widget,
 				     GtkStyle *previous,
 				     GtkWidget *event_box)
 {
+	GdkRGBA color;
+
 	/* The widget (a treeview here) needs to be realized to get proper style */
 	gtk_widget_realize (widget);
-	gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &gtk_widget_get_style (widget)->base[GTK_STATE_NORMAL]);
+	gdk_rgba_parse (&color, "white");
+	gtk_widget_override_background_color (event_box, GTK_STATE_NORMAL, &color);
 }
 
 static void
 brasero_utils_disc_realized_cb (GtkWidget *event_box,
 				GtkWidget *textview)
 {
+	GdkRGBA color;
+
 	/* The widget (a treeview here) needs to be realized to get proper style */
 	gtk_widget_realize (textview);
-	gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &gtk_widget_get_style (textview)->base[GTK_STATE_NORMAL]);
+	gdk_rgba_parse (&color, "white");
+	gtk_widget_override_background_color (event_box, GTK_STATE_NORMAL, &color);
 
 	g_signal_handlers_disconnect_by_func (textview,
 					      brasero_utils_disc_style_changed_cb,



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