GtkStyleSet: Return default value if value is not set.
This commit is contained in:
parent
9fdcbd7a84
commit
2da033b18c
@ -425,11 +425,13 @@ gtk_style_set_get_property (GtkStyleSet *set,
|
|||||||
prop = g_hash_table_lookup (priv->properties,
|
prop = g_hash_table_lookup (priv->properties,
|
||||||
GINT_TO_POINTER (node->property_quark));
|
GINT_TO_POINTER (node->property_quark));
|
||||||
|
|
||||||
if (!prop)
|
g_value_init (value, node->property_type);
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
g_value_init (value, G_VALUE_TYPE (&prop->values[state]));
|
if (!prop ||
|
||||||
g_value_copy (&prop->values[state], value);
|
!G_IS_VALUE (&prop->values[state]))
|
||||||
|
g_value_copy (&node->default_value, value);
|
||||||
|
else
|
||||||
|
g_value_copy (&prop->values[state], value);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -465,13 +467,11 @@ gtk_style_set_get_valist (GtkStyleSet *set,
|
|||||||
prop = g_hash_table_lookup (priv->properties,
|
prop = g_hash_table_lookup (priv->properties,
|
||||||
GINT_TO_POINTER (node->property_quark));
|
GINT_TO_POINTER (node->property_quark));
|
||||||
|
|
||||||
if (!prop)
|
if (!prop ||
|
||||||
{
|
!G_IS_VALUE (&prop->values[state]))
|
||||||
/* FIXME: Fill in default */
|
G_VALUE_LCOPY (&node->default_value, args, 0, &error);
|
||||||
break;
|
else
|
||||||
}
|
G_VALUE_LCOPY (&prop->values[state], args, 0, &error);
|
||||||
|
|
||||||
G_VALUE_LCOPY (&prop->values[state], args, 0, &error);
|
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user