mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
stylecontext: Split out a function
The function is used in multiple places, so split it out. In particular because I'm about to change it.
This commit is contained in:
parent
b55724e3a7
commit
c3f3a82db9
@ -604,3 +604,21 @@ _gtk_css_computed_values_cancel_animations (GtkCssComputedValues *values)
|
|||||||
values->animations = NULL;
|
values->animations = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GtkBitmask *
|
||||||
|
_gtk_css_computed_values_compute_dependencies (GtkCssComputedValues *values,
|
||||||
|
const GtkBitmask *parent_changes)
|
||||||
|
{
|
||||||
|
GtkBitmask *changes;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), _gtk_bitmask_new ());
|
||||||
|
|
||||||
|
changes = _gtk_bitmask_copy (parent_changes);
|
||||||
|
changes = _gtk_bitmask_intersect (changes, values->depends_on_parent);
|
||||||
|
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_COLOR))
|
||||||
|
changes = _gtk_bitmask_union (changes, values->depends_on_color);
|
||||||
|
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_FONT_SIZE))
|
||||||
|
changes = _gtk_bitmask_union (changes, values->depends_on_font_size);
|
||||||
|
|
||||||
|
return changes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -87,6 +87,8 @@ GtkCssValue * _gtk_css_computed_values_get_intrinsic_value (GtkCssCom
|
|||||||
guint id);
|
guint id);
|
||||||
GtkBitmask * _gtk_css_computed_values_get_difference (GtkCssComputedValues *values,
|
GtkBitmask * _gtk_css_computed_values_get_difference (GtkCssComputedValues *values,
|
||||||
GtkCssComputedValues *other);
|
GtkCssComputedValues *other);
|
||||||
|
GtkBitmask * _gtk_css_computed_values_compute_dependencies (GtkCssComputedValues *values,
|
||||||
|
const GtkBitmask *parent_changes);
|
||||||
|
|
||||||
void _gtk_css_computed_values_create_animations (GtkCssComputedValues *values,
|
void _gtk_css_computed_values_create_animations (GtkCssComputedValues *values,
|
||||||
GtkCssComputedValues *parent_values,
|
GtkCssComputedValues *parent_values,
|
||||||
|
@ -2955,12 +2955,7 @@ gtk_style_context_update_cache (GtkStyleContext *context,
|
|||||||
StyleData *data = value;
|
StyleData *data = value;
|
||||||
GtkBitmask *changes;
|
GtkBitmask *changes;
|
||||||
|
|
||||||
changes = _gtk_bitmask_copy (parent_changes);
|
changes = _gtk_css_computed_values_compute_dependencies (data->store, parent_changes);
|
||||||
changes = _gtk_bitmask_intersect (changes, data->store->depends_on_parent);
|
|
||||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_COLOR))
|
|
||||||
changes = _gtk_bitmask_union (changes, data->store->depends_on_color);
|
|
||||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_FONT_SIZE))
|
|
||||||
changes = _gtk_bitmask_union (changes, data->store->depends_on_font_size);
|
|
||||||
|
|
||||||
if (!_gtk_bitmask_is_empty (changes))
|
if (!_gtk_bitmask_is_empty (changes))
|
||||||
build_properties (context, data->store, info, changes);
|
build_properties (context, data->store, info, changes);
|
||||||
@ -3157,12 +3152,7 @@ _gtk_style_context_validate (GtkStyleContext *context,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
changes = _gtk_bitmask_copy (parent_changes);
|
changes = _gtk_css_computed_values_compute_dependencies (current->store, parent_changes);
|
||||||
changes = _gtk_bitmask_intersect (changes, current->store->depends_on_parent);
|
|
||||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_COLOR))
|
|
||||||
changes = _gtk_bitmask_union (changes, current->store->depends_on_color);
|
|
||||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_FONT_SIZE))
|
|
||||||
changes = _gtk_bitmask_union (changes, current->store->depends_on_font_size);
|
|
||||||
|
|
||||||
gtk_style_context_update_cache (context, parent_changes);
|
gtk_style_context_update_cache (context, parent_changes);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user