diff --git a/ChangeLog b/ChangeLog index ee2e0977..852dda66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ When the editor menu is opened by the Menu key, use the text cursor position for retrieving the current word. This fixes disabled Go to Tag items in the menu (#2780044). + * src/treeviews.c: + Set the "ellipsize" property of GtkCellRendererText to automatically + shorten the path and file names in the Documents list. 2009-04-21 Enrico Tröger diff --git a/src/treeviews.c b/src/treeviews.c index 562cc19f..32b097a0 100644 --- a/src/treeviews.c +++ b/src/treeviews.c @@ -241,6 +241,7 @@ static void prepare_openfiles(void) icon_renderer = gtk_cell_renderer_pixbuf_new(); text_renderer = gtk_cell_renderer_text_new(); + g_object_set(text_renderer, "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL); column = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start(column, icon_renderer, FALSE); gtk_tree_view_column_set_attributes(column, icon_renderer, "stock-id", DOCUMENTS_ICON, NULL); @@ -368,7 +369,7 @@ void treeviews_openfiles_add(GeanyDocument *doc) gtk_tree_view_expand_row(GTK_TREE_VIEW(tv.tree_openfiles), path, TRUE); gtk_tree_path_free(path); } - basename = document_get_basename_for_display(doc, 30); + basename = g_path_get_basename(DOC_FILENAME(doc)); gtk_tree_store_set(store_openfiles, iter, DOCUMENTS_ICON, GTK_STOCK_FILE, DOCUMENTS_SHORTNAME, basename, DOCUMENTS_DOCUMENT, doc, DOCUMENTS_COLOR, color, DOCUMENTS_FILENAME, DOC_FILENAME(doc), -1);