Prevent file filter name sizes from expanding the dialog (bgo #527499).

Made GtkFileChooser file filter combobox ellipsize.
This commit is contained in:
Tristan Van Berkom 2010-08-19 19:01:45 -04:00
parent 491bfd6355
commit 7ef9cc3a1c

View File

@ -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);