[gaim-migrate @ 4901]

Tue, 25 Feb 2003 01:48:36 +0000

author
Ka-Hing Cheung <khc@pidgin.im>
date
Tue, 25 Feb 2003 01:48:36 +0000
changeset 4612
c27625e13a26
parent 4611
f4e8e89a90b4
child 4613
837d01179f6d

[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: Luke Schierer <lschiere@pidgin.im>

src/gtkimhtml.c file | annotate | diff | comparison | revisions
--- 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++;

mercurial