[nautilus] properties-window: paint the pie backgorund with the notebook color



commit 785ee926b36165b4849903e5f4828a17aabe534c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Oct 4 21:30:44 2011 -0400

    properties-window: paint the pie backgorund with the notebook color
    
    We have to reset the GtkDrawingArea background to the notebook color, in
    case the theme specifies them to be different.

 src/nautilus-properties-window.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 7a524c1..8a70bb0 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2590,14 +2590,25 @@ paint_pie_chart (GtkWidget *widget,
 	double free, used;
 	double angle1, angle2, split, xc, yc, radius;
 	GtkAllocation allocation;
+	GtkStyleContext *notebook_ctx;
+	GdkRGBA bg_color;
 
 	window = NAUTILUS_PROPERTIES_WINDOW (data);
 	gtk_widget_get_allocation (widget, &allocation);
 
 	width  = allocation.width;
   	height = allocation.height;
-	
-		
+
+	notebook_ctx = gtk_widget_get_style_context (GTK_WIDGET (window->details->notebook));
+	gtk_style_context_get_background_color (notebook_ctx,
+						gtk_widget_get_state_flags (GTK_WIDGET (window->details->notebook)),
+						&bg_color);
+
+	cairo_save (cr);
+	gdk_cairo_set_source_rgba (cr, &bg_color);
+	cairo_paint (cr);
+	cairo_restore (cr);
+
 	free = (double)window->details->volume_free / (double)window->details->volume_capacity;
 	used =  1.0 - free;
 



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