mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
styleproperties: Implement unsetting directly
With subproperties, there's no need anymore for custom unset functions.
This commit is contained in:
parent
341a738dc6
commit
674485a138
@ -886,10 +886,23 @@ gtk_style_properties_unset_property (GtkStyleProperties *props,
|
||||
g_warning ("Style property \"%s\" is not registered", property);
|
||||
return;
|
||||
}
|
||||
|
||||
if (node->unset_func)
|
||||
if (_gtk_style_property_get_value_type (node) == G_TYPE_NONE)
|
||||
{
|
||||
node->unset_func (props, state);
|
||||
g_warning ("Style property \"%s\" is not settable", property);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GTK_IS_CSS_SHORTHAND_PROPERTY (node))
|
||||
{
|
||||
GtkCssShorthandProperty *shorthand = GTK_CSS_SHORTHAND_PROPERTY (node);
|
||||
|
||||
for (pos = 0; pos < _gtk_css_shorthand_property_get_n_subproperties (shorthand); pos++)
|
||||
{
|
||||
GtkCssStyleProperty *sub = _gtk_css_shorthand_property_get_subproperty (shorthand, pos);
|
||||
gtk_style_properties_unset_property (props,
|
||||
_gtk_style_property_get_name (GTK_STYLE_PROPERTY (sub)),
|
||||
state);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user