diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-03-20 22:20:36 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-03-20 22:20:36 +0000 |
commit | b93bcb5ecb7416c8832e57eb436bfdfa70f3593c (patch) | |
tree | 9a499e212e42b70a2e10d7bc0ba583dea05c414d /gtk/gtkrc.c | |
parent | 92febe2720cd229749e64e99ea31906bade84a44 (diff) | |
download | gtk+-b93bcb5ecb7416c8832e57eb436bfdfa70f3593c.tar.gz |
Patch from Richard Hestilow to fix gtk-font-name changes for widgets that
Wed Mar 20 17:11:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Patch from Richard Hestilow to fix
gtk-font-name changes for widgets that get the actual
default style. (#73709)
Diffstat (limited to 'gtk/gtkrc.c')
-rw-r--r-- | gtk/gtkrc.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index b9d3581cbf..7f400b765d 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -101,6 +101,7 @@ struct _GtkRcContext gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS]; gint default_priority; + GtkStyle *default_style; }; static GtkRcContext *gtk_rc_context_get (GtkSettings *settings); @@ -534,6 +535,7 @@ gtk_rc_context_get (GtkSettings *settings) context->rc_sets_widget_class = NULL; context->rc_sets_class = NULL; context->rc_files = NULL; + context->default_style = NULL; g_object_get (settings, "gtk-theme-name", &context->theme_name, @@ -1285,9 +1287,17 @@ _gtk_rc_context_get_default_font_name (GtkSettings *settings) if (new_font_name != context->font_name && !(new_font_name && strcmp (context->font_name, new_font_name) == 0)) { + gboolean reset = FALSE; g_free (context->font_name); context->font_name = g_strdup (new_font_name); + 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) @@ -1295,9 +1305,11 @@ _gtk_rc_context_get_default_font_name (GtkSettings *settings) g_hash_table_foreach (realized_style_ht, gtk_rc_clear_realized_style, NULL); g_hash_table_destroy (realized_style_ht); realized_style_ht = NULL; - - gtk_rc_reset_widgets (context); + reset = TRUE; } + + if (reset) + gtk_rc_reset_widgets (context); } g_free (new_font_name); @@ -1579,8 +1591,13 @@ gtk_rc_get_style (GtkWidget *widget) if (rc_styles) return gtk_rc_init_style (rc_styles); + else + { + if (!context->default_style) + context->default_style = gtk_style_new (); - return NULL; + return context->default_style; + } } /** |