aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-10-21 20:11:57 +0800
committerMilan Crha <mcrha@redhat.com>2011-10-21 20:11:57 +0800
commitd4571114e8b8949922213ac23825075880e59231 (patch)
tree09020a56858b1c9eed2e3c65cd3000acd7995dfe /e-util/e-util.c
parentd433cec97a7229a79e456a1987a3d3bd1dcb4d67 (diff)
downloadgsoc2013-evolution-d4571114e8b8949922213ac23825075880e59231.tar.gz
gsoc2013-evolution-d4571114e8b8949922213ac23825075880e59231.tar.zst
gsoc2013-evolution-d4571114e8b8949922213ac23825075880e59231.zip
Bug #660738 - Font changes ignored since 3.2
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index cd489849e4..cda17cbbc9 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -1390,9 +1390,19 @@ e_binding_transform_color_to_string (GBinding *binding,
g_return_val_if_fail (G_IS_BINDING (binding), FALSE);
color = g_value_get_boxed (source_value);
- string = gdk_color_to_string (color);
- g_value_set_string (target_value, string);
- g_free (string);
+ if (!color) {
+ g_value_set_string (target_value, "");
+ } else {
+ /* encode color manually, because css styles expect colors in #rrggbb,
+ not in #rrrrggggbbbb, which is a result of gdk_color_to_string()
+ */
+ string = g_strdup_printf ("#%02x%02x%02x",
+ (gint) color->red * 256 / 65536,
+ (gint) color->green * 256 / 65536,
+ (gint) color->blue * 256 / 65536);
+ g_value_set_string (target_value, string);
+ g_free (string);
+ }
return TRUE;
}