pidgin/gtkstatusbox.c

branch
next.minor
changeset 25901
805c4c220100
parent 25888
d0fdd378a635
child 25902
e00c2d18aad0
equal deleted inserted replaced
25900:0be61f1b3dd1 25901:805c4c220100
2553 wrapped_lines++; 2553 wrapped_lines++;
2554 if (wrapped_lines > 4) 2554 if (wrapped_lines > 4)
2555 break; 2555 break;
2556 } while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(status_box->imhtml), &iter)); 2556 } while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(status_box->imhtml), &iter));
2557 2557
2558 /*
2559 * This check fixes the case where the last character entered is a
2560 * newline (shift+return). For some reason the
2561 * gtk_text_view_forward_display_line() function doesn't treat this
2562 * like a new line, and so we think the input box only needs to be
2563 * two lines instead of three, for example. So we check if the
2564 * last character was a newline and add some extra height if so.
2565 */
2566 if (wrapped_lines <= 4
2567 && gtk_text_iter_backward_char(&iter)
2568 && gtk_text_iter_get_char(&iter) == '\n')
2569 {
2570 gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline);
2571 height += oneline.height;
2572 }
2573
2558 lines = gtk_text_buffer_get_line_count(buffer); 2574 lines = gtk_text_buffer_get_line_count(buffer);
2559 2575
2560 /* Show a maximum of 4 lines */ 2576 /* Show a maximum of 4 lines */
2561 lines = MIN(lines, 4); 2577 lines = MIN(lines, 4);
2562 wrapped_lines = MIN(wrapped_lines, 4); 2578 wrapped_lines = MIN(wrapped_lines, 4);

mercurial