pidgin/gtkconv.c

changeset 29217
903157b8f52b
parent 29193
e07ecf0ae368
child 29240
901af871b5f0
equal deleted inserted replaced
29212:d290f151a81f 29217:903157b8f52b
4650 int pad_top, pad_inside, pad_bottom; 4650 int pad_top, pad_inside, pad_bottom;
4651 int total_height = (gtkconv->imhtml->allocation.height + gtkconv->entry->allocation.height); 4651 int total_height = (gtkconv->imhtml->allocation.height + gtkconv->entry->allocation.height);
4652 int max_height = total_height / 2; 4652 int max_height = total_height / 2;
4653 int min_lines = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines"); 4653 int min_lines = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines");
4654 int min_height; 4654 int min_height;
4655 gboolean interior_focus;
4656 int focus_width;
4655 4657
4656 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry)); 4658 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry));
4657 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry)); 4659 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry));
4658 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry)); 4660 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry));
4659 4661
4675 /* Make sure there's enough room for at least min_lines. Allocate enough space to 4677 /* Make sure there's enough room for at least min_lines. Allocate enough space to
4676 * prevent scrolling when the second line is a continuation of the first line, or 4678 * prevent scrolling when the second line is a continuation of the first line, or
4677 * is the beginning of a new paragraph. */ 4679 * is the beginning of a new paragraph. */
4678 min_height = min_lines * (oneline.height + MAX(pad_inside, pad_top + pad_bottom)); 4680 min_height = min_lines * (oneline.height + MAX(pad_inside, pad_top + pad_bottom));
4679 height = CLAMP(height, MIN(min_height, max_height), max_height); 4681 height = CLAMP(height, MIN(min_height, max_height), max_height);
4682
4683 gtk_widget_style_get(gtkconv->entry,
4684 "interior-focus", &interior_focus,
4685 "focus-line-width", &focus_width,
4686 NULL);
4687 if (!interior_focus)
4688 height += 2 * focus_width;
4680 4689
4681 diff = height - gtkconv->entry->allocation.height; 4690 diff = height - gtkconv->entry->allocation.height;
4682 if (ABS(diff) < oneline.height / 2) 4691 if (ABS(diff) < oneline.height / 2)
4683 return FALSE; 4692 return FALSE;
4684 4693

mercurial