changeset 20838:effa512ad24a

fix the auto resize code for the showing formatting toolbar case, which is the default. Previously it wasn't taking the height of the formatting toolbar into account Surprisingly I don't see a ticket for this.
author Ka-Hing Cheung <khc@hxbc.us>
date Tue, 09 Oct 2007 03:13:02 +0000
parents ccb728fa5af8
children 83b662c458de
files pidgin/gtkconv.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Tue Oct 09 02:54:09 2007 +0000
+++ b/pidgin/gtkconv.c	Tue Oct 09 03:13:02 2007 +0000
@@ -4371,8 +4371,8 @@
 	int wrapped_lines;
 	int lines;
 	GdkRectangle oneline;
-	GtkRequisition sr;
-	int height;
+	GtkRequisition sr, entry_sr;
+	int height, diff;
 	int pad_top, pad_inside, pad_bottom;
 
 	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry));
@@ -4398,10 +4398,14 @@
 
 	gtkconv->auto_resize = TRUE;
 	g_idle_add(reset_auto_resize_cb, gtkconv);
-	gtk_widget_size_request(gtkconv->lower_hbox, &sr);
-	if (sr.height < height + PIDGIN_HIG_BOX_SPACE) {
+
+	gtk_widget_size_request(gtkconv->entry, &entry_sr);
+	diff = height - entry_sr.height;
+
+	if (diff > 0) {
+		gtk_widget_size_request(gtkconv->lower_hbox, &sr);
 		gtkconv->entry_growing = TRUE;
-		gtk_widget_set_size_request(gtkconv->lower_hbox, -1, height + PIDGIN_HIG_BOX_SPACE);
+		gtk_widget_set_size_request(gtkconv->lower_hbox, -1, diff + sr.height);
 	}
 }