summaryrefslogtreecommitdiff
path: root/gtk/gtkstyle.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-02-24 05:05:15 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-02-24 05:05:15 +0000
commit23a249a04320a65fc5648330683914b3b2d3748e (patch)
treefdd0a9c27af52240c69cdb94ea30114fcd7b0a1d /gtk/gtkstyle.c
parentc44a49fa0c5ff502d57d5cf43f78d0dafbc1aa7b (diff)
downloadgtk+-23a249a04320a65fc5648330683914b3b2d3748e.tar.gz
Sanity check default font family name and size.
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkstyle.c (gtk_style_init): Sanity check default font family name and size. * gtk/gtkwindow.c (gtk_window_set_default_size): Remove incorrect comment about the geometry widget. * gtk/gtkwindow.c (gtk_window_move_resize): Unset the gtk_window_resize)() information once we've set the size once, to avoid it coming back next time we queue a resize. (#72359) * gtk/gtkwindow.c (gtk_window_move_resize): Remove setthing of ->need_default_size from here, Havoc says that it should correspond more or less exactly to GTK_WIDGET_MAPPED (window).
Diffstat (limited to 'gtk/gtkstyle.c')
-rw-r--r--gtk/gtkstyle.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 608f5aed6a..eca446b3d0 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -486,9 +486,20 @@ 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 (font_name);
+ if (!pango_font_description_get_family (style->font_desc))
+ {
+ g_warning ("Default font does not have a family set");
+ pango_font_description_set_family (style->font_desc, "Sans");
+ }
+ if (pango_font_description_get_size (style->font_desc) <= 0)
+ {
+ g_warning ("Default font does not have a positive size");
+ pango_font_description_set_size (style->font_desc, 10 * PANGO_SCALE);
+ }
+
style->attach_count = 0;
style->colormap = NULL;
style->depth = -1;