+/**
+ * _gtk_rc_reset_styles:
+ * @settings: a #GtkSettings
+ *
+ * This setting resets all of our styles; we use it when the font
+ * rendering parameters or the icon sizes have changed. It's both less
+ * and more comprehensive then we actually need:
+ *
+ * Less comprehensive: it doesn't affect widgets that have a style
+ * set on them.
+ *
+ * More comprehensive: it resets the styles, but the styles haven't
+ * changed. The main reason for resetting the styles is becaues
+ * most widgets will redo all their font stuff when their style
+ * change.
+ **/
+void
+_gtk_rc_reset_styles (GtkSettings *settings)
+{
+ GtkRcContext *context;
+ gboolean reset = FALSE;
+
+ g_return_if_fail (GTK_IS_SETTINGS (settings));
+
+ context = gtk_rc_context_get (settings);
+
+ if (context->default_style)
+ {
+ g_object_unref (G_OBJECT (context->default_style));
+ context->default_style = NULL;
+ reset = TRUE;
+ }
+
+ /* Clear out styles that have been looked up already
+ */
+ if (realized_style_ht)
+ {
+ g_hash_table_foreach (realized_style_ht, gtk_rc_clear_realized_style, NULL);
+ g_hash_table_destroy (realized_style_ht);
+ realized_style_ht = NULL;
+ reset = TRUE;
+ }
+
+ if (reset)
+ gtk_rc_reset_widgets (settings);
+}
+