diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2010-10-22 18:53:54 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2010-10-22 20:14:57 +0200 |
commit | d2781bc74bc78e2311c797dc8e4620602b3571d3 (patch) | |
tree | d63c64ede63694c82619b6a9791e9292a84aa203 /gtk/gtkbuilder.c | |
parent | d1140d0b1e3969ee567c8fac51779eed71a18185 (diff) | |
download | gtk+-d2781bc74bc78e2311c797dc8e4620602b3571d3.tar.gz |
GtkBuilder: Prepare for parsing GdkRGBA types.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r-- | gtk/gtkbuilder.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 3a34fee99d..06ab4107ee 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -1559,6 +1559,22 @@ gtk_builder_value_from_string_type (GtkBuilder *builder, ret = FALSE; } } + else if (G_VALUE_HOLDS (value, GDK_TYPE_RGBA)) + { + GdkRGBA rgba = { 0 }; + + if (gdk_rgba_parse (string, &rgba)) + g_value_set_boxed (value, &rgba); + else + { + g_set_error (error, + GTK_BUILDER_ERROR, + GTK_BUILDER_ERROR_INVALID_VALUE, + "Could not parse RGBA color '%s'", + string); + ret = FALSE; + } + } else if (G_VALUE_HOLDS (value, G_TYPE_STRV)) { gchar **vector = g_strsplit (string, "\n", 0); |