gnome-control-center r8864 - trunk/capplets/display



Author: federico
Date: Sat Aug 16 02:00:48 2008
New Revision: 8864
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=8864&view=rev

Log:
Paint the outputs with the color from GnomeRRLabeler

Signed-off-by: Federico Mena Quintero <federico novell com>


Modified:
   trunk/capplets/display/ChangeLog
   trunk/capplets/display/xrandr-capplet.c

Modified: trunk/capplets/display/xrandr-capplet.c
==============================================================================
--- trunk/capplets/display/xrandr-capplet.c	(original)
+++ trunk/capplets/display/xrandr-capplet.c	Sat Aug 16 02:00:48 2008
@@ -1360,6 +1360,8 @@
     PangoRectangle extent;
     GdkRectangle viewport;
     double angle;
+    GdkColor output_color;
+    double r, g, b;
 
     cairo_save (cr);
 
@@ -1429,10 +1431,20 @@
     cairo_rectangle (cr, x, y, w * scale + 0.5, h * scale + 0.5);
     cairo_clip_preserve (cr);
 
-    if (output->on)
-	cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
-    else
-	cairo_set_source_rgba (cr, 0.2, 0.2, 0.2, 1.0);
+    gnome_rr_labeler_get_color_for_output (app->labeler, output, &output_color);
+    r = output_color.red / 65535.0;
+    g = output_color.green / 65535.0;
+    b = output_color.blue / 65535.0;
+
+    if (!output->on)
+    {
+	/* If the output is turned off, just darken the selected color */
+	r *= 0.2;
+	g *= 0.2;
+	b *= 0.2;
+    }
+
+    cairo_set_source_rgba (cr, r, g, b, 1.0);
 
     foo_scroll_area_add_input_from_fill (FOO_SCROLL_AREA (app->area),
 					 cr, on_output_event, output);



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