mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
css: Use _gtk_style_property_get_value_type() where appropriate
This commit is contained in:
parent
389531d15d
commit
5ae00c3755
@ -2356,7 +2356,7 @@ parse_declaration (GtkCssScanner *scanner,
|
||||
gtk_css_scanner_push_section (scanner, GTK_CSS_SECTION_VALUE);
|
||||
|
||||
val = property_value_new (scanner->section);
|
||||
g_value_init (&val->value, property->pspec->value_type);
|
||||
g_value_init (&val->value, _gtk_style_property_get_value_type (property));
|
||||
|
||||
if (_gtk_style_property_parse_value (property,
|
||||
&val->value,
|
||||
|
@ -244,7 +244,7 @@ _gtk_style_property_resolve (GtkStyleProperty *property,
|
||||
switch (special)
|
||||
{
|
||||
case GTK_CSS_CURRENT_COLOR:
|
||||
g_assert (property->pspec->value_type == GDK_TYPE_RGBA);
|
||||
g_assert (_gtk_style_property_get_value_type (property) == GDK_TYPE_RGBA);
|
||||
gtk_style_properties_get_property (props, "color", state, val);
|
||||
break;
|
||||
case GTK_CSS_INHERIT:
|
||||
@ -255,19 +255,19 @@ _gtk_style_property_resolve (GtkStyleProperty *property,
|
||||
}
|
||||
else if (G_VALUE_TYPE (val) == GTK_TYPE_SYMBOLIC_COLOR)
|
||||
{
|
||||
if (property->pspec->value_type == GDK_TYPE_RGBA)
|
||||
if (_gtk_style_property_get_value_type (property) == GDK_TYPE_RGBA)
|
||||
{
|
||||
if (resolve_color (props, val))
|
||||
goto out;
|
||||
}
|
||||
else if (property->pspec->value_type == GDK_TYPE_COLOR)
|
||||
else if (_gtk_style_property_get_value_type (property) == GDK_TYPE_COLOR)
|
||||
{
|
||||
if (resolve_color_rgb (props, val))
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_value_unset (val);
|
||||
g_value_init (val, property->pspec->value_type);
|
||||
g_value_init (val, _gtk_style_property_get_value_type (property));
|
||||
_gtk_style_property_default_value (property, props, state, val);
|
||||
}
|
||||
else if (G_VALUE_TYPE (val) == GDK_TYPE_RGBA)
|
||||
@ -277,7 +277,7 @@ _gtk_style_property_resolve (GtkStyleProperty *property,
|
||||
}
|
||||
else if (G_VALUE_TYPE (val) == GTK_TYPE_GRADIENT)
|
||||
{
|
||||
g_return_if_fail (property->pspec->value_type == CAIRO_GOBJECT_TYPE_PATTERN);
|
||||
g_return_if_fail (_gtk_style_property_get_value_type (property) == CAIRO_GOBJECT_TYPE_PATTERN);
|
||||
|
||||
if (!resolve_gradient (props, val))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user