| 4339 while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(gtkconv->entry), &iter)) |
4339 while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(gtkconv->entry), &iter)) |
| 4340 wrapped_lines++; |
4340 wrapped_lines++; |
| 4341 |
4341 |
| 4342 lines = gtk_text_buffer_get_line_count(buffer); |
4342 lines = gtk_text_buffer_get_line_count(buffer); |
| 4343 |
4343 |
| 4344 /* Show a maximum of 4 lines */ |
4344 /* Show a maximum of 4 lines, minimum of 2 */ |
| 4345 lines = MIN(lines, 4); |
4345 lines = MIN(MAX(lines, 2), 4); |
| 4346 wrapped_lines = MIN(wrapped_lines, 4); |
4346 wrapped_lines = MIN(MAX(wrapped_lines, 2), 4); |
| 4347 |
4347 |
| 4348 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry)); |
4348 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry)); |
| 4349 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry)); |
4349 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry)); |
| 4350 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry)); |
4350 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry)); |
| 4351 |
4351 |
| 4352 height = (oneline.height + pad_top + pad_bottom) * MAX(lines, 2); |
4352 height = (oneline.height + pad_top + pad_bottom) * lines; |
| 4353 height += (oneline.height + pad_inside) * (wrapped_lines - lines); |
4353 if (wrapped_lines > lines) |
| |
4354 height += (oneline.height + pad_inside) * (wrapped_lines - lines); |
| 4354 |
4355 |
| 4355 gtkconv->auto_resize = TRUE; |
4356 gtkconv->auto_resize = TRUE; |
| 4356 g_idle_add(reset_auto_resize_cb, gtkconv); |
4357 g_idle_add(reset_auto_resize_cb, gtkconv); |
| 4357 |
4358 |
| 4358 diff = height - gtkconv->entry->allocation.height; |
4359 diff = height - gtkconv->entry->allocation.height; |