widget: Update Pango context on state change

The layout depends on the state flags, so it must be updated when they
change.
This commit is contained in:
Benjamin Otte 2011-12-05 18:26:17 +01:00
parent c3cccf586c
commit 4259a27cf5

View File

@ -623,6 +623,8 @@ static void gtk_widget_real_get_width_for_height (GtkWidget
gint height, gint height,
gint *minimum_width, gint *minimum_width,
gint *natural_width); gint *natural_width);
static void gtk_widget_real_state_flags_changed (GtkWidget *widget,
GtkStateFlags old_state);
static const GtkWidgetAuxInfo* _gtk_widget_get_aux_info_or_defaults (GtkWidget *widget); static const GtkWidgetAuxInfo* _gtk_widget_get_aux_info_or_defaults (GtkWidget *widget);
static GtkWidgetAuxInfo* gtk_widget_get_aux_info (GtkWidget *widget, static GtkWidgetAuxInfo* gtk_widget_get_aux_info (GtkWidget *widget,
gboolean create); gboolean create);
@ -881,6 +883,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->get_preferred_width_for_height = gtk_widget_real_get_width_for_height; klass->get_preferred_width_for_height = gtk_widget_real_get_width_for_height;
klass->get_preferred_height_for_width = gtk_widget_real_get_height_for_width; klass->get_preferred_height_for_width = gtk_widget_real_get_height_for_width;
klass->state_changed = NULL; klass->state_changed = NULL;
klass->state_flags_changed = gtk_widget_real_state_flags_changed;
klass->parent_set = NULL; klass->parent_set = NULL;
klass->hierarchy_changed = NULL; klass->hierarchy_changed = NULL;
klass->style_set = gtk_widget_real_style_set; klass->style_set = gtk_widget_real_style_set;
@ -6516,6 +6519,13 @@ gtk_widget_real_query_tooltip (GtkWidget *widget,
return FALSE; return FALSE;
} }
static void
gtk_widget_real_state_flags_changed (GtkWidget *widget,
GtkStateFlags old_state)
{
gtk_widget_update_pango_context (widget);
}
static void static void
gtk_widget_real_style_updated (GtkWidget *widget) gtk_widget_real_style_updated (GtkWidget *widget)
{ {