[gtk+] icontheme: Use gdk_rgba_to_string()



commit a4c7f188de1658987a19cdeddb782f86334eece4
Author: Benjamin Otte <otte redhat com>
Date:   Sat Oct 5 21:31:33 2013 +0200

    icontheme: Use gdk_rgba_to_string()
    
    This gives us valid CSS. And now that librsvg parses valid CSS, that's a
    fine thing to use.
    
    And it fixes the problem where %g is locale-dependent.

 gtk/gtkicontheme.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 95235b1..fad7ff4 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -4077,17 +4077,6 @@ gdk_color_to_css (GdkColor *color)
                           color->blue >> 8);
 }
 
-static gchar *
-gdk_rgba_to_css (const GdkRGBA *color)
-{
-  /* drop alpha for now, since librsvg does not understand rgba() */
-  return g_strdup_printf ("rgba(%d,%d,%d,%g)",
-                          (gint)(color->red * 255),
-                          (gint)(color->green * 255),
-                          (gint)(color->blue * 255),
-                          color->alpha);
-}
-
 static void
 proxy_symbolic_pixbuf_destroy (guchar *pixels, gpointer data)
 {
@@ -4170,18 +4159,18 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo  *icon_info,
    * that would mean we have a broken style */
   g_return_val_if_fail (fg != NULL, NULL);
 
-  css_fg = gdk_rgba_to_css (fg);
+  css_fg = gdk_rgba_to_string (fg);
 
   css_success = css_warning = css_error = NULL;
 
   if (warning_color)
-    css_warning = gdk_rgba_to_css (warning_color);
+    css_warning = gdk_rgba_to_string (warning_color);
 
   if (error_color)
-    css_error = gdk_rgba_to_css (error_color);
+    css_error = gdk_rgba_to_string (error_color);
 
   if (success_color)
-    css_success = gdk_rgba_to_css (success_color);
+    css_success = gdk_rgba_to_string (success_color);
 
   if (!css_success)
     {


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