[gnome-software] trivial: Fix a CSS error when decimal is not '.'



commit 3cc46612e29c3398511ae2126e1d448df0f984ec
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jun 1 10:53:24 2016 +0100

    trivial: Fix a CSS error when decimal is not '.'

 src/gs-category-tile.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-category-tile.c b/src/gs-category-tile.c
index ce628d6..fffe2ec 100644
--- a/src/gs-category-tile.c
+++ b/src/gs-category-tile.c
@@ -67,12 +67,8 @@ gs_category_tile_set_category (GsCategoryTile *tile, GsCategory *cat)
        if (gs_category_get_important (cat) && key_colors->len > 0) {
                GdkRGBA *tmp = g_ptr_array_index (key_colors, 0);
                g_autofree gchar *css = NULL;
-               css = g_strdup_printf ("border-bottom: 3px solid "
-                                      "rgba(%.0f,%.0f,%.0f,%.2f);",
-                                      tmp->red * 255,
-                                      tmp->green * 255,
-                                      tmp->blue * 255,
-                                      tmp->alpha);
+               g_autofree gchar *color = gdk_rgba_to_string (tmp);;
+               css = g_strdup_printf ("border-bottom: 3px solid %s", color);
                gs_utils_widget_set_css_simple (GTK_WIDGET (tile), css);
        }
 }


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