widget: Add _gtk_widget_invalidate_style_context()

This is supposed to replace gtk_widget_reset_style().
This commit is contained in:
Benjamin Otte 2012-03-20 15:40:53 +01:00
parent 48a8ca8bbe
commit d589566f40
2 changed files with 22 additions and 7 deletions

View File

@ -8104,10 +8104,7 @@ static void
modifier_style_changed (GtkModifierStyle *style,
GtkWidget *widget)
{
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
gtk_style_context_invalidate (context);
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_ANY);
}
static GtkModifierStyle *
@ -14069,8 +14066,7 @@ gtk_widget_get_path (GtkWidget *widget)
gtk_widget_path_append_for_widget (widget->priv->path, widget);
}
if (widget->priv->context)
gtk_style_context_invalidate (widget->priv->context);
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_ANY);
}
return widget->priv->path;
@ -14133,6 +14129,20 @@ gtk_widget_get_style_context (GtkWidget *widget)
return widget->priv->context;
}
void
_gtk_widget_invalidate_style_context (GtkWidget *widget,
GtkCssChange change)
{
GtkWidgetPrivate *priv;
priv = widget->priv;
if (priv->context == NULL)
return;
_gtk_style_context_queue_invalidate (priv->context, change);
}
/**
* gtk_widget_get_modifier_mask:
* @widget: a #GtkWidget

View File

@ -25,6 +25,9 @@
#ifndef __GTK_WIDGET_PRIVATE_H__
#define __GTK_WIDGET_PRIVATE_H__
#include "gtkcsstypesprivate.h"
#include "gtkwidget.h"
G_BEGIN_DECLS
/* Cache as many ranges of height-for-width
@ -173,7 +176,9 @@ void _gtk_widget_set_captured_event_handler (GtkWidget
gboolean _gtk_widget_captured_event (GtkWidget *widget,
GdkEvent *event);
void _gtk_widget_style_context_invalidated (GtkWidget *widget);
void _gtk_widget_invalidate_style_context (GtkWidget *widget,
GtkCssChange change);
void _gtk_widget_style_context_invalidated (GtkWidget *widget);
G_END_DECLS