im.pidgin.pidgin: 98f414fd8c19ebbe05b120aebf6d73e9dc34de0e

nosnilmot at pidgin.im nosnilmot at pidgin.im
Wed Dec 12 15:40:49 EST 2007


-----------------------------------------------------------------
Revision: 98f414fd8c19ebbe05b120aebf6d73e9dc34de0e
Ancestor: 91746962ac5f36dd22a2e6bbbf858aaa429af27e
Author: nosnilmot at pidgin.im
Date: 2007-12-12T20:37:29
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkconv.c

ChangeLog: 

Another tweak to the auto-resizing so it shows new empty lines correctly,
and deals with wrapped lines a bit better.

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	96eee3925de1dcd3e1fa0ac3072b8a2841758c7e
+++ pidgin/gtkconv.c	d31a0039c986a98fef4a4517d0607b88c72950a3
@@ -4341,16 +4341,17 @@ static gboolean resize_imhtml_cb(PidginC
 
 	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);


More information about the Commits mailing list