From 7ef9cc3a1c221c1402dae1e025bbd5d71a5c51a2 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Thu, 19 Aug 2010 19:01:45 -0400 Subject: [PATCH] Prevent file filter name sizes from expanding the dialog (bgo #527499). Made GtkFileChooser file filter combobox ellipsize. --- gtk/gtkfilechooserdefault.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 18c9ac0c67..6802dc87fe 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -2382,9 +2382,23 @@ renderer_editing_canceled_cb (GtkCellRendererText *cell_renderer_text, static GtkWidget * filter_create (GtkFileChooserDefault *impl) { + GtkCellRenderer *cell; + GList *cells; + impl->filter_combo = gtk_combo_box_new_text (); gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (impl->filter_combo), FALSE); + /* Get the combo's text renderer and set ellipsize parameters */ + cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (impl->filter_combo)); + g_assert (cells); + cell = cells->data; + + g_object_set (G_OBJECT (cell), + "ellipsize", PANGO_ELLIPSIZE_END, + NULL); + + g_list_free (cells); + g_signal_connect (impl->filter_combo, "changed", G_CALLBACK (filter_combo_changed), impl);