# HG changeset patch # User Gabriel Schulhof # Date 1263683681 0 # Node ID 5c2bbeef2eb8e30b02b94ec27dba056dad4243b8 # Parent 9dc0f311d3836e39a9192b170bcb4c92bbd2536a 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 diff -r 9dc0f311d383 -r 5c2bbeef2eb8 ChangeLog --- a/ChangeLog Sat Jan 16 01:10:45 2010 +0000 +++ b/ChangeLog Sat Jan 16 23:14:41 2010 +0000 @@ -24,6 +24,10 @@ (when given by the result of the "last query") and don't show status as offline. + Pidgin: + * Correctly size conversation and status box entries when the + interior-focus style property is diabled. (Gabriel Schulhof) + version 2.6.5 (01/08/2010): libpurple: * TLS certificates are actually stored to the local cache once again diff -r 9dc0f311d383 -r 5c2bbeef2eb8 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Sat Jan 16 01:10:45 2010 +0000 +++ b/pidgin/gtkconv.c Sat Jan 16 23:14:41 2010 +0000 @@ -4652,6 +4652,8 @@ int max_height = total_height / 2; int min_lines = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines"); int min_height; + gboolean interior_focus; + int focus_width; 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)); @@ -4678,6 +4680,13 @@ min_height = min_lines * (oneline.height + MAX(pad_inside, pad_top + pad_bottom)); height = CLAMP(height, MIN(min_height, max_height), max_height); + gtk_widget_style_get(gtkconv->entry, + "interior-focus", &interior_focus, + "focus-line-width", &focus_width, + NULL); + if (!interior_focus) + height += 2 * focus_width; + diff = height - gtkconv->entry->allocation.height; if (ABS(diff) < oneline.height / 2) return FALSE; diff -r 9dc0f311d383 -r 5c2bbeef2eb8 pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Sat Jan 16 01:10:45 2010 +0000 +++ b/pidgin/gtkstatusbox.c Sat Jan 16 23:14:41 2010 +0000 @@ -2541,6 +2541,8 @@ GdkRectangle oneline; int height; int pad_top, pad_inside, pad_bottom; + gboolean interior_focus; + int focus_width; if (!status_box->imhtml_visible) { @@ -2591,6 +2593,13 @@ height += (pad_top + pad_bottom) * lines; height += (pad_inside) * (display_lines - lines); + gtk_widget_style_get(status_box->imhtml, + "interior-focus", &interior_focus, + "focus-line-width", &focus_width, + NULL); + if (!interior_focus) + height += 2 * focus_width; + gtk_widget_set_size_request(status_box->vbox, -1, height + PIDGIN_HIG_BOX_SPACE); }