forked from AuroraMiddleware/gtk
css: Remove _gtk_css_style_property_changes_affect_size()
... and _gtk_css_style_property_changes_affect_font(). Replace it with _gtk_css_style_property_get_mask_affecting().
This commit is contained in:
parent
488ea44a59
commit
aa1b7fab9c
@ -47,9 +47,6 @@ enum {
|
||||
|
||||
G_DEFINE_TYPE (GtkCssStyleProperty, _gtk_css_style_property, GTK_TYPE_STYLE_PROPERTY)
|
||||
|
||||
static GtkBitmask *_properties_affecting_size = NULL;
|
||||
static GtkBitmask *_properties_affecting_font = NULL;
|
||||
|
||||
static GtkCssStylePropertyClass *gtk_css_style_property_class = NULL;
|
||||
|
||||
static void
|
||||
@ -61,12 +58,6 @@ gtk_css_style_property_constructed (GObject *object)
|
||||
property->id = klass->style_properties->len;
|
||||
g_ptr_array_add (klass->style_properties, property);
|
||||
|
||||
if (property->affects & (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP))
|
||||
_properties_affecting_size = _gtk_bitmask_set (_properties_affecting_size, property->id, TRUE);
|
||||
|
||||
if (property->affects & GTK_CSS_AFFECTS_FONT)
|
||||
_properties_affecting_font = _gtk_bitmask_set (_properties_affecting_font, property->id, TRUE);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_css_style_property_parent_class)->constructed (object);
|
||||
}
|
||||
|
||||
@ -253,9 +244,6 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
|
||||
|
||||
klass->style_properties = g_ptr_array_new ();
|
||||
|
||||
_properties_affecting_size = _gtk_bitmask_new ();
|
||||
_properties_affecting_font = _gtk_bitmask_new ();
|
||||
|
||||
gtk_css_style_property_class = klass;
|
||||
}
|
||||
|
||||
@ -435,14 +423,3 @@ _gtk_css_style_property_get_mask_affecting (GtkCssAffects affects)
|
||||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gtk_css_style_property_changes_affect_size (const GtkBitmask *changes)
|
||||
{
|
||||
return _gtk_bitmask_intersects (changes, _properties_affecting_size);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gtk_css_style_property_changes_affect_font (const GtkBitmask *changes)
|
||||
{
|
||||
return _gtk_bitmask_intersects (changes, _properties_affecting_font);
|
||||
}
|
||||
|
@ -85,10 +85,6 @@ void _gtk_css_style_property_print_value (GtkCssStyleProp
|
||||
|
||||
GtkBitmask * _gtk_css_style_property_get_mask_affecting
|
||||
(GtkCssAffects affects);
|
||||
gboolean _gtk_css_style_property_changes_affect_size
|
||||
(const GtkBitmask *changes);
|
||||
gboolean _gtk_css_style_property_changes_affect_font
|
||||
(const GtkBitmask *changes);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -4454,12 +4454,16 @@ gtk_text_view_set_background (GtkTextView *text_view)
|
||||
static void
|
||||
gtk_text_view_style_updated (GtkWidget *widget)
|
||||
{
|
||||
static GtkBitmask *affects_font = NULL;
|
||||
GtkTextView *text_view;
|
||||
GtkTextViewPrivate *priv;
|
||||
PangoContext *ltr_context, *rtl_context;
|
||||
GtkStyleContext *style_context;
|
||||
const GtkBitmask *changes;
|
||||
|
||||
if (G_UNLIKELY (affects_font) == NULL)
|
||||
affects_font = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_FONT);
|
||||
|
||||
text_view = GTK_TEXT_VIEW (widget);
|
||||
priv = text_view->priv;
|
||||
|
||||
@ -4473,7 +4477,8 @@ gtk_text_view_style_updated (GtkWidget *widget)
|
||||
|
||||
style_context = gtk_widget_get_style_context (widget);
|
||||
changes = _gtk_style_context_get_changes (style_context);
|
||||
if ((changes == NULL || _gtk_css_style_property_changes_affect_font (changes)) &&
|
||||
|
||||
if ((changes == NULL || _gtk_bitmask_intersects (changes, affects_font)) &&
|
||||
priv->layout && priv->layout->default_style)
|
||||
{
|
||||
gtk_text_view_set_attributes_from_style (text_view,
|
||||
|
@ -8700,12 +8700,16 @@ gtk_tree_view_grab_focus (GtkWidget *widget)
|
||||
static void
|
||||
gtk_tree_view_style_updated (GtkWidget *widget)
|
||||
{
|
||||
static GtkBitmask *affects_size = NULL;
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
|
||||
GList *list;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkStyleContext *style_context;
|
||||
const GtkBitmask *changes;
|
||||
|
||||
if (G_UNLIKELY (affects_size) == NULL)
|
||||
affects_size = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->style_updated (widget);
|
||||
|
||||
if (gtk_widget_get_realized (widget))
|
||||
@ -8718,7 +8722,8 @@ gtk_tree_view_style_updated (GtkWidget *widget)
|
||||
|
||||
style_context = gtk_widget_get_style_context (widget);
|
||||
changes = _gtk_style_context_get_changes (style_context);
|
||||
if (changes == NULL || _gtk_css_style_property_changes_affect_size (changes))
|
||||
|
||||
if (changes == NULL || _gtk_bitmask_intersects (changes, affects_size))
|
||||
{
|
||||
for (list = tree_view->priv->columns; list; list = list->next)
|
||||
{
|
||||
|
@ -8229,7 +8229,12 @@ gtk_widget_real_style_updated (GtkWidget *widget)
|
||||
|
||||
if (widget->priv->anchored)
|
||||
{
|
||||
if (changes == NULL || _gtk_css_style_property_changes_affect_size (changes))
|
||||
static GtkBitmask *affects_size = NULL;
|
||||
|
||||
if (G_UNLIKELY (affects_size) == NULL)
|
||||
affects_size = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP);
|
||||
|
||||
if (changes == NULL || _gtk_bitmask_intersects (changes, affects_size))
|
||||
gtk_widget_queue_resize (widget);
|
||||
else
|
||||
gtk_widget_queue_draw (widget);
|
||||
|
Loading…
Reference in New Issue
Block a user