changeset 22816:dec78ddd46aa

merge of 'a9db18c93f28f014cb3740a20933e2468fb660b7' and 'c8ee8202f366caf4f495343b196b2eef5be5a5b7'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 02 May 2008 17:09:50 +0000
parents 9cbb7c2aba23 (diff) b4a0f4b32ba5 (current diff)
children 6b182ab4bc05
files
diffstat 2 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Fri May 02 16:51:15 2008 +0000
+++ b/pidgin/gtkconv.c	Fri May 02 17:09:50 2008 +0000
@@ -4458,7 +4458,9 @@
 	GdkRectangle oneline;
 	int height, diff;
 	int pad_top, pad_inside, pad_bottom;
-	int max_height = (gtkconv->imhtml->allocation.height + gtkconv->entry->allocation.height) / 2;
+	int total_height = (gtkconv->imhtml->allocation.height + gtkconv->entry->allocation.height);
+	int max_height = total_height / 2;
+	int min_height;
 
 	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));
@@ -4482,12 +4484,11 @@
 	/* Make sure there's enough room for at least two lines. Allocate enough space to
 	 * prevent scrolling when the second line is a continuation of the first line, or
 	 * is the beginning of a new paragraph. */
-	height = MAX(height, 2 * (oneline.height + MAX(pad_inside, pad_top + pad_bottom)));
-
-	height = MIN(height, max_height);
+	min_height = 2 * (oneline.height + MAX(pad_inside, pad_top + pad_bottom));
+	height = CLAMP(height, min_height, max_height);
 
 	diff = height - gtkconv->entry->allocation.height;
-	if (diff == 0 || (diff < 0 && -diff < oneline.height / 2))
+	if (ABS(diff) < oneline.height / 2)
 		return FALSE;
 
 	gtk_widget_set_size_request(gtkconv->lower_hbox, -1,
@@ -4764,6 +4765,7 @@
 
 	/* Setup the gtkimhtml widget */
 	frame = pidgin_create_imhtml(FALSE, &gtkconv->imhtml, NULL, &imhtml_sw);
+	gtk_widget_set_size_request(gtkconv->imhtml, -1, 0);
 	if (chat) {
 		GtkWidget *hpaned;
 
--- a/pidgin/gtkrequest.c	Fri May 02 16:51:15 2008 +0000
+++ b/pidgin/gtkrequest.c	Fri May 02 17:09:50 2008 +0000
@@ -1282,6 +1282,7 @@
 				size_t col_offset = col_num * 2;
 				PurpleRequestFieldType type;
 				GtkWidget *widget = NULL;
+				const char *field_label;
 
 				label = NULL;
 				field = fl->data;
@@ -1292,17 +1293,17 @@
 				}
 
 				type = purple_request_field_get_type(field);
+				field_label = purple_request_field_get_label(field);
 
-				if (type != PURPLE_REQUEST_FIELD_BOOLEAN &&
-				    purple_request_field_get_label(field))
+				if (type != PURPLE_REQUEST_FIELD_BOOLEAN && field_label)
 				{
-					char *text;
+					char *text = NULL;
 
-					text = g_strdup_printf("%s:",
-						purple_request_field_get_label(field));
+					if (field_label[strlen(field_label) - 1] != ':')
+						text = g_strdup_printf("%s:", field_label);
 
 					label = gtk_label_new(NULL);
-					gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), text);
+					gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), text ? text : field_label);
 					g_free(text);
 
 					gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);