Mercurial > pidgin.yaz
comparison pidgin/gtkconv.c @ 29282:5c2bbeef2eb8
Patch from Gabriel Schulhof to correctly size the GtkIMHtml entry in the
conversation and status box when the 'interior-focus' style is FALSE.
Fixes #10675.
committer: Elliott Sales de Andrade <qulogic@pidgin.im>
author | Gabriel Schulhof <nix@go-nix.ca> |
---|---|
date | Sat, 16 Jan 2010 23:14:41 +0000 |
parents | 3a43e48c870e |
children | 31d9677b0c36 9c3e0f2e82ea |
comparison
equal
deleted
inserted
replaced
29281:9dc0f311d383 | 29282:5c2bbeef2eb8 |
---|---|
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 |