mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-07 01:00:28 +00:00
GtkWidget: Add gtk_widget_reset_style().
This function is analogous to gtk_widget_reset_rc_styles(), updates style recursively on a widget.
This commit is contained in:
parent
3c390c9c8e
commit
f239704094
@ -8125,17 +8125,33 @@ _gtk_widget_propagate_screen_changed (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
reset_rc_styles_recurse (GtkWidget *widget, gpointer data)
|
||||
reset_style_recurse (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
#if 0
|
||||
if (widget->priv->rc_style)
|
||||
gtk_widget_reset_rc_style (widget);
|
||||
#endif
|
||||
|
||||
context = g_object_get_qdata (G_OBJECT (widget),
|
||||
quark_style_context);
|
||||
if (context)
|
||||
gtk_style_context_invalidate (context);
|
||||
|
||||
if (GTK_IS_CONTAINER (widget))
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
reset_rc_styles_recurse,
|
||||
reset_style_recurse,
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_reset_style (GtkWidget *widget)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
reset_style_recurse (widget, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_reset_rc_styles:
|
||||
@ -8152,7 +8168,7 @@ gtk_widget_reset_rc_styles (GtkWidget *widget)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
reset_rc_styles_recurse (widget, NULL);
|
||||
reset_style_recurse (widget, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -803,6 +803,8 @@ gchar* gtk_widget_get_composite_name (GtkWidget *widget);
|
||||
/* Descend recursively and set rc-style on all widgets without user styles */
|
||||
void gtk_widget_reset_rc_styles (GtkWidget *widget);
|
||||
|
||||
void gtk_widget_reset_style (GtkWidget *widget);
|
||||
|
||||
/* Push/pop pairs, to change default values upon a widget's creation.
|
||||
* This will override the values that got set by the
|
||||
* gtk_widget_set_default_* () functions.
|
||||
|
Loading…
Reference in New Issue
Block a user