mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 06:51:10 +00:00
GtkBuilder: Prepare for parsing GdkRGBA types.
This commit is contained in:
parent
d1140d0b1e
commit
d2781bc74b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user