# HG changeset patch # User Will Thompson # Date 1205762916 0 # Node ID 43f28905e2fd58182b7b4ac6b3a38aa9a76c5d56 # Parent 5c216e2c5405a737ce164f50ed8e402dcbfdb8ae Limit the text input area to half the conversation's height. Also, remove an unused GtkRequisition lookup. diff -r 5c216e2c5405 -r 43f28905e2fd pidgin/gtkconv.c --- a/pidgin/gtkconv.c Mon Mar 17 13:38:34 2008 +0000 +++ b/pidgin/gtkconv.c Mon Mar 17 14:08:36 2008 +0000 @@ -4366,9 +4366,9 @@ int wrapped_lines; int lines; GdkRectangle oneline; - GtkRequisition sr; int height, diff; int pad_top, pad_inside, pad_bottom; + int max_height = gtkconv->tab_cont->allocation.height / 2; buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); @@ -4380,9 +4380,8 @@ lines = gtk_text_buffer_get_line_count(buffer); - /* Show a maximum of 4 lines */ - lines = MIN(lines, 4); - wrapped_lines = MIN(MAX(wrapped_lines, 2), 4); + /* Show at least two lines */ + wrapped_lines = MAX(wrapped_lines, 2); 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)); @@ -4392,12 +4391,12 @@ if (wrapped_lines > lines) height += (oneline.height + pad_inside) * (wrapped_lines - lines); + height = MIN(height, max_height); + diff = height - gtkconv->entry->allocation.height; if (diff == 0 || (diff < 0 && -diff < oneline.height / 2)) return FALSE; - gtk_widget_size_request(gtkconv->lower_hbox, &sr); - gtk_widget_set_size_request(gtkconv->lower_hbox, -1, diff + gtkconv->lower_hbox->allocation.height);