[gnome-terminal/gsettings] fixup! Use GdkRGBA instead of GdkColor



commit bddb27252aaaec39651db9cf7da8104d9650d835
Author: Christian Persch <chpe gnome org>
Date:   Sat Aug 13 16:00:07 2011 +0200

    fixup! Use GdkRGBA instead of GdkColor

 src/profile-editor.c  |    8 ++++----
 src/terminal-screen.c |    6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 5dc1323..1355fa2 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -183,7 +183,7 @@ rgba_equal (const GdkRGBA *a,
   db = a->blue - b->blue;
   da = a->alpha - b->alpha;
 
-  return (dr * dr + dg * dg + db * db + da * da) < 1e-5;
+  return (dr * dr + dg * dg + db * db + da * da) < 1e-4;
 }
 
 static gboolean
@@ -278,8 +278,8 @@ profile_colors_notify_scheme_combo_cb (GSettings *profile,
 
   for (i = 0; i < G_N_ELEMENTS (color_schemes); ++i)
     {
-      if (gdk_rgba_equal (&fg, &color_schemes[i].foreground) &&
-          gdk_rgba_equal (&bg, &color_schemes[i].background))
+      if (rgba_equal (&fg, &color_schemes[i].foreground) &&
+          rgba_equal (&bg, &color_schemes[i].background))
         break;
     }
   /* If we didn't find a match, then we get the last combo box item which is "custom" */
@@ -377,7 +377,7 @@ profile_palette_notify_colorpickers_cb (GSettings *profile,
       w = (GtkWidget *) gtk_builder_get_object  (builder, name);
 
       gtk_color_button_get_rgba (GTK_COLOR_BUTTON (w), &old_color);
-      if (!gdk_rgba_equal (&old_color, &colors[i]))
+      if (!rgba_equal (&old_color, &colors[i]))
         {
           g_signal_handlers_block_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
           gtk_color_button_set_rgba (GTK_COLOR_BUTTON (w), &colors[i]);
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index d6d723d..eec3bf4 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1866,9 +1866,9 @@ terminal_screen_drag_data_received (GtkWidget        *widget,
         if (selection_data_length != 8)
           return;
 
-        color.red = data[0] / 65535.;
-        color.green = data[1] / 65535.;
-        color.blue = data[2] / 65535.;
+        color.red = (double) data[0] / 65535.;
+        color.green = (double) data[1] / 65535.;
+        color.blue = (double) data[2] / 65535.;
         color.alpha = 1.;
         /* FIXME: use opacity from data[3] */
 



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