im.pidgin.pidgin: 8f01978e548005303588d73de8202f9434b8e3db

khc at pidgin.im khc at pidgin.im
Mon Oct 8 23:40:37 EDT 2007


-----------------------------------------------------------------
Revision: 8f01978e548005303588d73de8202f9434b8e3db
Ancestor: c62d29ba9f12404999d6ff94564dd951ea8f9c44
Author: khc at pidgin.im
Date: 2007-10-09T03:13:02
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkconv.c

ChangeLog: 

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.


-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	6c2880cd9cf22afdaa82f977e0096d4aeff4d13f
+++ pidgin/gtkconv.c	b371ab366a67883557cc1a095d6c2628f840398d
@@ -4371,8 +4371,8 @@ static void resize_imhtml_cb(PidginConve
 	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 @@ static void resize_imhtml_cb(PidginConve
 
 	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);
 	}
 }
 


More information about the Commits mailing list