styleproperties: resolve properties of type GTK_TYPE_SHADOW

https://bugzilla.gnome.org/show_bug.cgi?id=649314
This commit is contained in:
Cosimo Cecchi 2011-05-20 16:11:41 -04:00
parent 016f540931
commit c3f3e4a670

View File

@ -845,6 +845,29 @@ resolve_gradient (GtkStyleProperties *props,
return TRUE;
}
static gboolean
resolve_shadow (GtkStyleProperties *props,
GValue *value)
{
GtkShadow *resolved, *base;
base = g_value_get_boxed (value);
if (base == NULL)
return TRUE;
if (_gtk_shadow_get_resolved (base))
return TRUE;
resolved = _gtk_shadow_resolve (base, props);
if (resolved == NULL)
return FALSE;
g_value_take_boxed (value, resolved);
return TRUE;
}
static gboolean
style_properties_resolve_type (GtkStyleProperties *props,
PropertyNode *node,
@ -872,6 +895,11 @@ style_properties_resolve_type (GtkStyleProperties *props,
if (!resolve_gradient (props, val))
return FALSE;
}
else if (val && G_VALUE_TYPE (val) == GTK_TYPE_SHADOW)
{
if (!resolve_shadow (props, val))
return FALSE;
}
return TRUE;
}