+Sat Feb 23 20:59:05 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkstyle.c gtk/gtkrc.[ch]: gtk/gtksettings.c gtk/gtkstyle.c:
+ Patch from Richard Hestilow to add a gtk-font-name GtkSetting.
+
+ * gdk/x11/gdkevents-x11.c: Add Gtk/FontName XSETTING.
+
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Move inclusion of <windows.h> before inclusion
+Sat Feb 23 20:59:05 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkstyle.c gtk/gtkrc.[ch]: gtk/gtksettings.c gtk/gtkstyle.c:
+ Patch from Richard Hestilow to add a gtk-font-name GtkSetting.
+
+ * gdk/x11/gdkevents-x11.c: Add Gtk/FontName XSETTING.
+
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Move inclusion of <windows.h> before inclusion
+Sat Feb 23 20:59:05 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkstyle.c gtk/gtkrc.[ch]: gtk/gtksettings.c gtk/gtkstyle.c:
+ Patch from Richard Hestilow to add a gtk-font-name GtkSetting.
+
+ * gdk/x11/gdkevents-x11.c: Add Gtk/FontName XSETTING.
+
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Move inclusion of <windows.h> before inclusion
+Sat Feb 23 20:59:05 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkstyle.c gtk/gtkrc.[ch]: gtk/gtksettings.c gtk/gtkstyle.c:
+ Patch from Richard Hestilow to add a gtk-font-name GtkSetting.
+
+ * gdk/x11/gdkevents-x11.c: Add Gtk/FontName XSETTING.
+
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Move inclusion of <windows.h> before inclusion
+Sat Feb 23 20:59:05 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkstyle.c gtk/gtkrc.[ch]: gtk/gtksettings.c gtk/gtkstyle.c:
+ Patch from Richard Hestilow to add a gtk-font-name GtkSetting.
+
+ * gdk/x11/gdkevents-x11.c: Add Gtk/FontName XSETTING.
+
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Move inclusion of <windows.h> before inclusion
+Sat Feb 23 20:59:05 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkstyle.c gtk/gtkrc.[ch]: gtk/gtksettings.c gtk/gtkstyle.c:
+ Patch from Richard Hestilow to add a gtk-font-name GtkSetting.
+
+ * gdk/x11/gdkevents-x11.c: Add Gtk/FontName XSETTING.
+
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Move inclusion of <windows.h> before inclusion
+Sat Feb 23 20:59:05 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkstyle.c gtk/gtkrc.[ch]: gtk/gtksettings.c gtk/gtkstyle.c:
+ Patch from Richard Hestilow to add a gtk-font-name GtkSetting.
+
+ * gdk/x11/gdkevents-x11.c: Add Gtk/FontName XSETTING.
+
2002-02-24 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Move inclusion of <windows.h> before inclusion
</para>
+<!-- ##### ARG GtkSettings:gtk-font-name ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkSettings:gtk-color-palette ##### -->
<para>
{ "Net/DndDragThreshold", "gtk-dnd-drag-threshold" },
{ "Gtk/CanChangeAccels", "gtk-can-change-accels" },
{ "Gtk/ColorPalette", "gtk-color-palette" },
+ { "Gtk/FontName", "gtk-font-name" },
+ { "Gtk/KeyThemeName", "gtk-key-theme-name" },
{ "Gtk/ToolbarStyle", "gtk-toolbar-style" },
{ "Gtk/ToolbarIconSize", "gtk-toolbar-icon-size" },
{ "Net/CursorBlink", "gtk-cursor-blink" },
{ "Net/CursorBlinkTime", "gtk-cursor-blink-time" },
- { "Net/ThemeName", "gtk-theme-name" },
- { "Gtk/KeyThemeName", "gtk-key-theme-name" }
+ { "Net/ThemeName", "gtk-theme-name" }
};
static void
gchar *theme_name;
gchar *key_theme_name;
+ gchar *font_name;
gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS];
g_free (new_key_theme_name);
}
+static void
+gtk_rc_font_name_changed (GtkSettings *settings,
+ GParamSpec *pspec,
+ GtkRcContext *context)
+{
+ _gtk_rc_context_get_default_font_name (settings);
+}
+
static GtkRcContext *
gtk_rc_context_get (GtkSettings *settings)
{
g_object_get (settings,
"gtk-theme-name", &context->theme_name,
"gtk-key-theme-name", &context->key_theme_name,
+ "gtk-font-name", &context->font_name,
NULL);
g_signal_connect (settings,
"notify::gtk-key-theme-name",
G_CALLBACK (gtk_rc_settings_changed),
context);
+ g_signal_connect (settings,
+ "notify::gtk-font-name",
+ G_CALLBACK (gtk_rc_font_name_changed),
+ context);
+
context->pixmap_path[0] = NULL;
g_list_free (toplevels);
}
+void
+gtk_rc_clear_realized_style (gpointer key,
+ gpointer value,
+ gpointer data)
+{
+ GSList *rc_styles = key;
+ GSList *tmp_list = rc_styles;
+
+ while (tmp_list)
+ {
+ GtkRcStyle *rc_style = tmp_list->data;
+
+ rc_style->rc_style_lists = g_slist_remove_all (rc_style->rc_style_lists,
+ rc_styles);
+ tmp_list = tmp_list->next;
+ }
+
+ g_slist_free (rc_styles);
+}
+
+const gchar*
+_gtk_rc_context_get_default_font_name (GtkSettings *settings)
+{
+ GtkRcContext *context;
+ gchar *new_font_name;
+
+ g_return_val_if_fail (GTK_IS_SETTINGS (settings), NULL);
+
+ context = gtk_rc_context_get (settings);
+
+ g_object_get (context->settings,
+ "gtk-font-name", &new_font_name,
+ NULL);
+
+ if (new_font_name != context->font_name && !(new_font_name && strcmp (context->font_name, new_font_name) == 0))
+ {
+ g_free (context->font_name);
+ context->font_name = g_strdup (new_font_name);
+
+ /* 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;
+
+ gtk_rc_reset_widgets (context);
+ }
+ }
+
+ g_free (new_font_name);
+
+ return context->font_name;
+}
+
/**
* gtk_rc_reparse_all_for_settings:
* @settings: a #GtkSettings
g_free (context->theme_name);
g_free (context->key_theme_name);
+
g_object_get (context->settings,
"gtk-theme-name", &context->theme_name,
"gtk-key-theme-name", &context->key_theme_name,
return G_TOKEN_STRING;
g_warning ("module_path directive is now ignored\n");
-
+
return G_TOKEN_NONE;
}
gchar* gtk_win32_get_installation_directory (void);
#endif
+const gchar* _gtk_rc_context_get_default_font_name (GtkSettings *settings);
#ifdef __cplusplus
}
PROP_THEME_NAME,
PROP_KEY_THEME_NAME,
PROP_MENU_BAR_ACCEL,
- PROP_DND_DRAG_THRESHOLD
+ PROP_DND_DRAG_THRESHOLD,
+ PROP_FONT_NAME
};
G_PARAM_READWRITE),
NULL);
g_assert (result == PROP_DND_DRAG_THRESHOLD);
-
+
+ result = settings_install_property_parser (class,
+ g_param_spec_string ("gtk-font-name",
+ _("Font Name"),
+ _("Name of default font to use"),
+ "Sans 10",
+ G_PARAM_READWRITE),
+ NULL);
+ g_assert (result == PROP_FONT_NAME);
+
}
static void
gtk_style_init (GtkStyle *style)
{
gint i;
+ const gchar *font_name = _gtk_rc_context_get_default_font_name (gtk_settings_get_default ());
- style->font_desc = pango_font_description_from_string ("Sans 10");
+ style->font_desc = pango_font_description_from_string (font_name);
style->attach_count = 0;
style->colormap = NULL;
return;
}
if (widget && GTK_IS_SPIN_BUTTON (widget) &&
- detail && strcmp (detail, "spinbutton") == 0)
+ detail && strcmp (detail, "spinbutton") == 0)
{
draw_spinbutton_shadow (style, window, state_type,
gtk_widget_get_direction (widget), area, x, y, width, height);