changeset 15119:4bf1777efb1f

[gaim-migrate @ 17904] I was getting a scrollbar in the statusbox with only one line of message. This fixes that. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 07 Dec 2006 02:48:08 +0000
parents 1f0db03dd165
children acf1b5803346
files gtk/gtkstatusbox.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkstatusbox.c	Wed Dec 06 23:05:51 2006 +0000
+++ b/gtk/gtkstatusbox.c	Thu Dec 07 02:48:08 2006 +0000
@@ -1661,7 +1661,7 @@
 	/* If the gtkimhtml is visible, then add some additional padding */
 	gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->vbox, &box_req);
 	if (box_req.height > 1)
-		requisition->height += box_req.height + border_width;
+		requisition->height += box_req.height + border_width * 2;
 
 	requisition->width = 1;
 }
@@ -1726,7 +1726,7 @@
 	box_alc.height = MAX(1, ((allocation->height - req.height) - (border_width*2)));
 	box_alc.x += border_width;
 	box_alc.y += req.height + border_width;
-	gtk_widget_size_allocate((GTK_GAIM_STATUS_BOX(widget))->vbox, &box_alc);
+	gtk_widget_size_allocate(status_box->vbox, &box_alc);
 
 	parent_alc = *allocation;
 	parent_alc.height = MAX(1,req.height - (border_width *2));
@@ -2201,6 +2201,7 @@
 
 	wrapped_lines = 1;
 	gtk_text_buffer_get_start_iter(buffer, &iter);
+	gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline);
 	while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(status_box->imhtml), &iter))
 		wrapped_lines++;
 
@@ -2210,9 +2211,6 @@
 	lines = MIN(lines, 4);
 	wrapped_lines = MIN(wrapped_lines, 4);
 
-	gtk_text_buffer_get_start_iter(buffer, &iter);
-	gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline);
-
 	pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(status_box->imhtml));
 	pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(status_box->imhtml));
 	pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(status_box->imhtml));