[gnome-control-center] Adapt to gnome-desktop API change for display labels



commit cd867b1158f5fca433e7920aa84eb4e6f7080d7b
Author: William Jon McCann <jmccann redhat com>
Date:   Tue May 8 16:14:57 2012 -0400

    Adapt to gnome-desktop API change for display labels
    
    GdkColor -> GdkRGBA

 configure.ac                      |    2 +-
 panels/display/cc-display-panel.c |   21 ++++++++-------------
 2 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7560be1..beab7cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,7 +76,7 @@ POLKIT_REQUIRED_VERSION=0.103
 GSD_REQUIRED_VERSION=3.3.91
 NETWORK_MANAGER_REQUIRED_VERSION=0.8.992
 LIBNOTIFY_REQUIRED_VERSION=0.7.3
-GNOME_DESKTOP_REQUIRED_VERSION=3.1.91
+GNOME_DESKTOP_REQUIRED_VERSION=3.5.1
 SCHEMAS_REQUIRED_VERSION=3.3.0
 LIBWACOM_REQUIRED_VERSION=0.3
 
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index ec14a35..c902d8c 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -617,7 +617,7 @@ static void
 rebuild_current_monitor_label (CcDisplayPanel *self)
 {
   char *str, *tmp;
-  GdkColor color;
+  GdkRGBA color;
   gboolean use_color;
 
   if (self->priv->current_output)
@@ -628,7 +628,7 @@ rebuild_current_monitor_label (CcDisplayPanel *self)
         tmp = g_strdup (gnome_rr_output_info_get_display_name (self->priv->current_output));
 
       str = g_strdup_printf ("<b>%s</b>", tmp);
-      gnome_rr_labeler_get_color_for_output (self->priv->labeler, self->priv->current_output, &color);
+      gnome_rr_labeler_get_rgba_for_output (self->priv->labeler, self->priv->current_output, &color);
       use_color = TRUE;
       g_free (tmp);
     }
@@ -644,15 +644,10 @@ rebuild_current_monitor_label (CcDisplayPanel *self)
   if (use_color)
     {
       GdkRGBA black = { 0, 0, 0, 1.0 };
-      GdkRGBA light;
 
-      light.red = color.red / 65535.0;
-      light.green = color.green / 65535.0;
-      light.blue = color.blue / 65535.0;
-      light.alpha = 1.0;
       gtk_widget_override_background_color (self->priv->current_monitor_event_box,
                                             gtk_widget_get_state_flags (self->priv->current_monitor_event_box),
-                                            &light);
+                                            &color);
 
       /* Make the label explicitly black.  We don't want it to follow the
        * theme's colors, since the label is always shown against a light
@@ -1958,7 +1953,7 @@ paint_output (CcDisplayPanel *self, cairo_t *cr, int i)
   PangoLayout *layout = get_display_name (self, output);
   PangoRectangle ink_extent, log_extent;
   GdkRectangle viewport;
-  GdkColor output_color;
+  GdkRGBA output_color;
   double r, g, b;
   double available_w;
   double factor;
@@ -2023,10 +2018,10 @@ paint_output (CcDisplayPanel *self, cairo_t *cr, int i)
   cairo_rectangle (cr, x, y, w * scale + 0.5, h * scale + 0.5);
   cairo_clip_preserve (cr);
 
-  gnome_rr_labeler_get_color_for_output (self->priv->labeler, output, &output_color);
-  r = output_color.red / 65535.0;
-  g = output_color.green / 65535.0;
-  b = output_color.blue / 65535.0;
+  gnome_rr_labeler_get_rgba_for_output (self->priv->labeler, output, &output_color);
+  r = output_color.red;
+  g = output_color.green;
+  b = output_color.blue;
 
   if (!gnome_rr_output_info_is_active (output))
     {



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