Commit f8ced336 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

add comment about how this should be fixed

2002-01-16  Havoc Pennington  <hp@redhat.com>

	* libnautilus-private/nautilus-file-operations.c
	(ellipsize_string_for_dialog): add comment about how this should
	be fixed

	* components/news/nautilus-news.c (ellipsize_string): add comment
	about how this should be fixed
parent 0e367139
2002-01-16 Havoc Pennington <hp@redhat.com>
* libnautilus-private/nautilus-file-operations.c
(ellipsize_string_for_dialog): add comment about how this should
be fixed
* components/news/nautilus-news.c (ellipsize_string): add comment
about how this should be fixed
2002-01-21 Darin Adler <darin@bentspoon.com>
* icons/Makefile.am:
......
......@@ -1139,7 +1139,15 @@ ellipsize_string (const char *raw_text)
{
char *result, *last_char_ptr;
int truncated_length;
#ifdef GNOME2_CONVERSION_COMPLETE
/* FIXME this is in no way UTF-8 safe. It should share code with
* nautilus-file-operations.c to ellipsize a string to a max char length
* (different from ellipsizing to a max pixel width as with
* eel_pango_layout_set_text_ellipsized)
*/
#endif
if (raw_text == NULL) {
return NULL;
}
......
......@@ -227,6 +227,20 @@ ellipsize_string_for_dialog (const char *str)
GdkFont *font;
int maximum_width;
/* I believe the most appropriate fix here is to change it to be based on
* some number of characters, rather than on a pixel width.
* We just can't do anything sane with the pixel width since
* we don't have all the PangoLayout information.
*
* So in brief we want an ellipsize function in eel which
* takes a number of chars, computes log attrs for the string,
* and chops the string at one of the is_cursor_position points,
* such that the string has fewer chars than the given number.
*
* Code in nautilus-news.c implements this in a UTF-8-unsafe way,
* should be moved to Eel and used here as well.
*/
/* get a nice length to ellipsize to, based on the font */
font = get_label_font ();
maximum_width = gdk_string_width (font, "MMMMMMMMMMMMMMMMMMMMMM");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment