changeset 4612:c05e6ecdc902

[gaim-migrate @ 4901] Ka-Hing Cheung (bsponline) wrote a patch allowing you to scroll up w/out gaim automatically scrolling you back down. it causes some annoyance with multiple tabs and the history plugin, but its an improvement over the current situation. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 25 Feb 2003 01:48:36 +0000
parents e42d9186a8a0
children 5385b3625a72
files src/gtkimhtml.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Tue Feb 25 01:16:51 2003 +0000
+++ b/src/gtkimhtml.c	Tue Feb 25 01:48:36 2003 +0000
@@ -764,6 +764,9 @@
 
 	GSList *fonts = NULL;
 
+	GdkRectangle rect;
+	int y, height;
+
 	g_return_val_if_fail (imhtml != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_IMHTML (imhtml), NULL);
 	g_return_val_if_fail (text != NULL, NULL);
@@ -780,6 +783,15 @@
 
 	gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter);
 	mark = gtk_text_buffer_create_mark (imhtml->text_buffer, NULL, &iter, /* right grav */ FALSE);
+
+	gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect);	
+	gtk_text_view_get_line_yrange(GTK_TEXT_VIEW(imhtml), &iter, &y, &height);
+
+	if(((y + height) - (rect.y + rect.height)) > height 
+	   && gtk_text_buffer_get_char_count(imhtml->text_buffer)){
+		options |= GTK_IMHTML_NO_SCROLL;
+	}
+
 	while (pos < len) {
 		if (*c == '<' && gtk_imhtml_is_tag (c + 1, &tag, &tlen, &type)) {
 			c++;