changeset 6056:395116fdd270

[gaim-migrate @ 6506] I'm reverting the patch to make f2 retroactively toggle timestamps because it causes highlighting in the gtkimhtml window to act strangely when timestamps are disabled. Cheung, if you think you can fix this please do, but it seems like it's due to the incomplete nature of invisibility in GtkTextViews. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 08 Jul 2003 01:28:42 +0000
parents d4ca918e041f
children dc2124210882
files ChangeLog src/gtkimhtml.c src/gtkimhtml.h
diffstat 3 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 07 23:15:24 2003 +0000
+++ b/ChangeLog	Tue Jul 08 01:28:42 2003 +0000
@@ -28,8 +28,6 @@
 	* Ability to view iChat "Available" messages for AIM
 	* Stores your buddy icon on the server for AIM
 	* Support for non-ascii characters with Yahoo! Messenger
-	* F2 toggles the display of timestamps retroactively once again 
-	  (Thanks Ka-Hing Cheung)
 
 version 0.64 (05/29/2003):
 	* Buddy list sorting in buddy list preferences.
--- a/src/gtkimhtml.c	Mon Jul 07 23:15:24 2003 +0000
+++ b/src/gtkimhtml.c	Tue Jul 08 01:28:42 2003 +0000
@@ -385,6 +385,7 @@
 	imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR);
 
 	imhtml->show_smileys = TRUE;
+	imhtml->show_comments = TRUE;
 
 	imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal,
 			g_free, (GDestroyNotify)gtk_smiley_tree_destroy);
@@ -400,8 +401,6 @@
 	imhtml->tip_window = NULL;
 
 	imhtml->scalables = NULL;
-
-	gtk_text_buffer_create_tag(imhtml->text_buffer, "comment", "invisible", FALSE, NULL);
 }
 
 GtkWidget *gtk_imhtml_new(void *a, void *b)
@@ -962,9 +961,6 @@
 								imhtml->scalables = g_list_append(imhtml->scalables, scalable); \
 								gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter); \
                         } \
-						if (x == NEW_COMMENT_BIT) { \
-							gtk_text_buffer_apply_tag_by_name(imhtml->text_buffer, "comment", &siter, &iter); \
-						} \
 
 
 
@@ -1321,7 +1317,8 @@
 					break;
 				case 59:	/* comment */
 					NEW_BIT (NEW_TEXT_BIT);
-					wpos = g_snprintf (ws, len, "%s", tag);
+					if (imhtml->show_comments)
+						wpos = g_snprintf (ws, len, "%s", tag);
 					NEW_BIT (NEW_COMMENT_BIT);
 					break;
 				default:
@@ -1449,9 +1446,7 @@
 void       gtk_imhtml_show_comments    (GtkIMHtml        *imhtml,
 					gboolean          show)
 {
-	GtkTextTagTable *table = gtk_text_buffer_get_tag_table(imhtml->text_buffer);
-	GtkTextTag *tag = gtk_text_tag_table_lookup(table, "comment");
-	g_object_set(G_OBJECT(tag), "invisible", !show, NULL);
+	imhtml->show_comments = show;
 }
 
 void
--- a/src/gtkimhtml.h	Mon Jul 07 23:15:24 2003 +0000
+++ b/src/gtkimhtml.h	Tue Jul 08 01:28:42 2003 +0000
@@ -58,6 +58,7 @@
 	GtkSmileyTree *default_smilies;
 
 	gboolean show_smileys;
+	gboolean show_comments;
 
 	GtkWidget *tip_window;
 	char *tip;