summaryrefslogtreecommitdiff
path: root/gtk/gtkfontsel.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-03-05 23:10:11 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-03-05 23:10:11 +0000
commit776870fcffd0073ae68b2cf39b570c78edde7ba9 (patch)
tree9abf56a130ad62f54d5d1c0930f9017a0a530811 /gtk/gtkfontsel.c
parent314a1b60d8af2bfcc55e60cfa0f1a78e95dcc758 (diff)
downloadgtk+-776870fcffd0073ae68b2cf39b570c78edde7ba9.tar.gz
Don't create ->font_entry, ->font_style_entry at all rather than just not
Tue Mar 5 17:43:43 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkfontsel.c (gtk_font_selection_init): Don't create ->font_entry, ->font_style_entry at all rather than just not showing them to avoid the problem of them popping up if gtk_widget_show_all() is done on the dialog. (#72913, Charles Kerr.)
Diffstat (limited to 'gtk/gtkfontsel.c')
-rw-r--r--gtk/gtkfontsel.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 853b368ee3..6b9f2e9106 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -56,6 +56,14 @@
#include "gtkscrolledwindow.h"
#include "gtkintl.h"
+/* We don't enable the font and style entries because they don't add
+ * much in terms of visible effect and have a weird effect on keynav.
+ * the Windows font selector has entries similarly positioned but they
+ * act in conjunction with the associated lists to form a single focus
+ * location.
+ */
+#undef INCLUDE_FONT_ENTRIES
+
/* This is the default text shown in the preview entry, though the user
can set it. Remember that some fonts only have capital letters. */
#define PREVIEW_TEXT N_("abcdefghijk ABCDEFGHIJK")
@@ -285,19 +293,21 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
gtk_table_set_col_spacings (GTK_TABLE (table), 8);
gtk_box_pack_start (GTK_BOX (fontsel), table, TRUE, TRUE, 0);
+#ifdef INCLUDE_FONT_ENTRIES
fontsel->font_entry = gtk_entry_new ();
gtk_entry_set_editable (GTK_ENTRY (fontsel->font_entry), FALSE);
gtk_widget_set_usize (fontsel->font_entry, 20, -1);
- /* gtk_widget_show (fontsel->font_entry); */
+ gtk_widget_show (fontsel->font_entry);
gtk_table_attach (GTK_TABLE (table), fontsel->font_entry, 0, 1, 1, 2,
GTK_FILL, 0, 0, 0);
fontsel->font_style_entry = gtk_entry_new ();
gtk_entry_set_editable (GTK_ENTRY (fontsel->font_style_entry), FALSE);
gtk_widget_set_usize (fontsel->font_style_entry, 20, -1);
- /* gtk_widget_show (fontsel->font_style_entry); */
+ gtk_widget_show (fontsel->font_style_entry);
gtk_table_attach (GTK_TABLE (table), fontsel->font_style_entry, 1, 2, 1, 2,
GTK_FILL, 0, 0, 0);
+#endif /* INCLUDE_FONT_ENTRIES */
fontsel->size_entry = gtk_entry_new ();
gtk_widget_set_usize (fontsel->size_entry, 20, -1);
@@ -588,7 +598,9 @@ gtk_font_selection_select_font (GtkTreeSelection *selection,
family_name = pango_font_family_get_name (fontsel->family);
+#ifdef INCLUDE_FONT_ENTRIES
gtk_entry_set_text (GTK_ENTRY (fontsel->font_entry), family_name);
+#endif
gtk_font_selection_show_available_styles (fontsel);
gtk_font_selection_select_best_style (fontsel, TRUE);
@@ -646,8 +658,10 @@ gtk_font_selection_show_available_fonts (GtkFontSelection *fontsel)
if (match_family)
{
set_cursor_to_iter (GTK_TREE_VIEW (fontsel->family_list), &match_row);
+#ifdef INCLUDE_FONT_ENTRIES
gtk_entry_set_text (GTK_ENTRY (fontsel->font_entry),
pango_font_family_get_name (match_family));
+#endif /* INCLUDE_FONT_ENTRIES */
}
g_free (families);
@@ -761,7 +775,9 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
{
const gchar *str = pango_font_face_get_face_name (fontsel->face);
+#ifdef INCLUDE_FONT_ENTRIES
gtk_entry_set_text (GTK_ENTRY (fontsel->font_style_entry), str);
+#endif
set_cursor_to_iter (GTK_TREE_VIEW (fontsel->face_list), &match_row);
}