pidgin: 38836a6f: Patch from Gabriel Schulhof to correctly...

qulogic at pidgin.im qulogic at pidgin.im
Tue Jan 19 01:36:35 EST 2010


-----------------------------------------------------------------
Revision: 38836a6fb6223fe51eb9fbea43f15513c5ce577b
Ancestor: e9e8173477a4a3613ddaceb20c95f9342ce01de2
Author: nix at go-nix.ca
Date: 2010-01-16T23:14:41
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/38836a6fb6223fe51eb9fbea43f15513c5ce577b

Modified files:
        ChangeLog pidgin/gtkconv.c pidgin/gtkstatusbox.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- ChangeLog	87c4e92ffd7d102b7c731eebe1310de697106fea
+++ ChangeLog	683cc24a30fa86f6bbd1baf840e49dea7b630df4
@@ -24,6 +24,10 @@ version 2.6.6 (??/??/20??):
 	  (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
============================================================
--- pidgin/gtkconv.c	4185d0c9653bbf92a803a9af494341287c7a6c5e
+++ pidgin/gtkconv.c	96f43914d1afcbabc9bae69cc31c3dcc1010f374
@@ -4652,6 +4652,8 @@ static gboolean resize_imhtml_cb(PidginC
 	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 @@ static gboolean resize_imhtml_cb(PidginC
 	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;
============================================================
--- pidgin/gtkstatusbox.c	ea7f05c6a6a0e8120e4b7ab0a12fec612a9dd581
+++ pidgin/gtkstatusbox.c	4b8cd9dd5a021cd296b30db65004b3d3cf70e507
@@ -2541,6 +2541,8 @@ static void update_size(PidginStatusBox 
 	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 @@ static void update_size(PidginStatusBox 
 	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);
 }
 


More information about the Commits mailing list