summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-09-20 03:37:11 +0200
committerBenjamin Otte <otte@redhat.com>2011-09-22 21:44:04 +0200
commit3a77b7e0050f3db2472649824b81711c22871232 (patch)
tree3ce6a600c0fd2446326a6561c72ef32d369ce3e2 /gtk
parentded10365a12740ecb80c7ce0021b4bb9834f6cf7 (diff)
downloadgtk+-3a77b7e0050f3db2472649824b81711c22871232.tar.gz
fontchooser: Don't scroll in the populate_list() function
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfontchooserwidget.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index 955eea619c..8190b44f49 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -636,14 +636,6 @@ populate_list (GtkFontChooserWidget *fontchooser,
GtkListStore *model)
{
GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
- GtkStyleContext *style_context;
- PangoFontDescription *default_font;
- PangoFontDescription *selected_font;
-
- gint match;
- GtkTreeIter match_row;
- GtkTreePath *path;
-
gint n_families, i;
PangoFontFamily **families;
gchar *tmp;
@@ -655,19 +647,8 @@ populate_list (GtkFontChooserWidget *fontchooser,
qsort (families, n_families, sizeof (PangoFontFamily *), cmp_families);
- style_context = gtk_widget_get_style_context (GTK_WIDGET (treeview));
- default_font = (PangoFontDescription*) gtk_style_context_get_font (style_context,
- GTK_STATE_NORMAL);
-
- if (priv->face)
- selected_font = pango_font_face_describe (priv->face);
- else
- selected_font = NULL;
-
gtk_list_store_clear (model);
- match = 0;
-
/* Iterate over families and faces */
for (i = 0; i < n_families; i++)
{
@@ -702,29 +683,6 @@ populate_list (GtkFontChooserWidget *fontchooser,
PREVIEW_TEXT_COLUMN, tmp,
-1);
- /* Select the current font,
- * the default font/face from the theme,
- * or the first font
- */
- if (match < 3 &&
- selected_font != NULL &&
- pango_font_description_equal (selected_font, pango_desc))
- {
- match_row = iter;
- match = 3;
- }
- if (match < 2 &&
- strcmp (fam_name, pango_font_description_get_family (default_font)) == 0)
- {
- match_row = iter;
- match = 2;
- }
- if (match < 1)
- {
- match_row = iter;
- match = 1;
- }
-
pango_font_description_free (pango_desc);
g_free (family_and_face);
g_free (tmp);
@@ -734,17 +692,6 @@ populate_list (GtkFontChooserWidget *fontchooser,
g_free (faces);
}
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &match_row);
- if (path)
- {
- gtk_tree_view_set_cursor (treeview, path, NULL, FALSE);
- gtk_tree_view_scroll_to_cell (treeview, path, NULL, FALSE, 0.5, 0.5);
- gtk_tree_path_free (path);
- }
-
- if (selected_font)
- pango_font_description_free (selected_font);
-
g_free (families);
}