diff src/gtkimhtmltoolbar.c @ 10777:ffa44a5159e0

[gaim-migrate @ 12392] To test Tim's new code, I needed a way to set background colors, so I changed gtkimhtmltoolbar such that now it will set the body background color unless text is selected in which case it will set the font background color on that text only. That seems sensible. Then I tested Tim's new code and it went into an infinite loop. Twice ;). Maybe I'll have time to check that out later. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 03 Apr 2005 03:51:59 +0000
parents c4cb90065e1d
children 364a2ef907ae
line wrap: on
line diff
--- a/src/gtkimhtmltoolbar.c	Sat Apr 02 23:59:49 2005 +0000
+++ b/src/gtkimhtmltoolbar.c	Sun Apr 03 03:51:59 2005 +0000
@@ -315,7 +315,10 @@
 			   text_color.red / 256,
 			   text_color.green / 256,
 			   text_color.blue / 256);
-	gtk_imhtml_toggle_backcolor(GTK_IMHTML(toolbar->imhtml), open_tag);
+	if (gtk_text_buffer_get_selection_bounds(GTK_IMHTML(toolbar->imhtml)->text_buffer, NULL, NULL))
+		gtk_imhtml_toggle_backcolor(GTK_IMHTML(toolbar->imhtml), open_tag);
+	else
+		gtk_imhtml_toggle_background(GTK_IMHTML(toolbar->imhtml), open_tag);
 
 	g_free(open_tag);
 	cancel_toolbar_bgcolor(NULL, toolbar);