# HG changeset patch # User Stu Tomlinson # Date 1197491849 0 # Node ID 9bdfeeea91455033d1d47b2107cb06d916bb8bdf # Parent 189abce087ab2ee5342f40856fe45cea1024462e Another tweak to the auto-resizing so it shows new empty lines correctly, and deals with wrapped lines a bit better. diff -r 189abce087ab -r 9bdfeeea9145 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Wed Dec 12 19:15:01 2007 +0000 +++ b/pidgin/gtkconv.c Wed Dec 12 20:37:29 2007 +0000 @@ -4341,16 +4341,17 @@ lines = gtk_text_buffer_get_line_count(buffer); - /* Show a maximum of 4 lines */ - lines = MIN(lines, 4); - wrapped_lines = MIN(wrapped_lines, 4); + /* Show a maximum of 4 lines, minimum of 2 */ + lines = MIN(MAX(lines, 2), 4); + wrapped_lines = MIN(MAX(wrapped_lines, 2), 4); pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry)); pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry)); pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry)); - height = (oneline.height + pad_top + pad_bottom) * MAX(lines, 2); - height += (oneline.height + pad_inside) * (wrapped_lines - lines); + height = (oneline.height + pad_top + pad_bottom) * lines; + if (wrapped_lines > lines) + height += (oneline.height + pad_inside) * (wrapped_lines - lines); gtkconv->auto_resize = TRUE; g_idle_add(reset_auto_resize_cb, gtkconv);