]> git.0d.be Git - empathy.git/commitdiff
factor out empathy_make_color_whiter()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 15 Dec 2010 13:43:31 +0000 (14:43 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 15 Dec 2010 15:47:25 +0000 (16:47 +0100)
libempathy-gtk/empathy-account-widget.c
libempathy-gtk/empathy-ui-utils.c
libempathy-gtk/empathy-ui-utils.h

index 7df208a796fe5e13810baee38100b959f4722e8f..ea1572021d640c718fd67c178361b1e18d471671 100644 (file)
@@ -235,7 +235,6 @@ account_widget_set_entry_highlighting (GtkEntry *entry,
     {
       GtkStyleContext *style;
       GdkRGBA color;
-      const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
 
       style = gtk_widget_get_style_context (GTK_WIDGET (entry));
       gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
@@ -246,9 +245,7 @@ account_widget_set_entry_highlighting (GtkEntry *entry,
        * gives a colour which is inline with the theme but
        * slightly whiter.
        */
-      color.red = (color.red + (white).red) / 2;
-      color.green = (color.green + (white).green) / 2;
-      color.blue = (color.blue + (white).blue) / 2;
+      empathy_make_color_whiter (&color);
 
       gtk_widget_override_background_color (GTK_WIDGET (entry), 0, &color);
     }
index 043c03eb30d88b9e6e05c8ba523629ac84ac17c4..d7abb9a5ebd24fa33c3828cc1d7df5de35d9299a 100644 (file)
@@ -1898,3 +1898,13 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
        gtk_widget_show (widget);
        g_free (title);
 }
+
+void
+empathy_make_color_whiter (GdkRGBA *color)
+{
+       const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
+
+       color->red = (color->red + (white).red) / 2;
+       color->green = (color->green + (white).green) / 2;
+       color->blue = (color->blue + (white).blue) / 2;
+}
index 0b76d09a359495d869c8706f1974ff5464f3ff96..0ff637a33c4fed0e529299d0e459988d8366ca11 100644 (file)
@@ -145,6 +145,9 @@ void        empathy_send_file_from_uri_list             (EmpathyContact   *conta
 void        empathy_send_file_with_file_chooser         (EmpathyContact   *contact);
 void        empathy_receive_file_with_file_chooser      (EmpathyFTHandler *handler);
 
+/* Misc */
+void        empathy_make_color_whiter                   (GdkRGBA *color);
+
 G_END_DECLS
 
 #endif /*  __EMPATHY_UI_UTILS_H__ */