comparison 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
comparison
equal deleted inserted replaced
10776:b640d066eb51 10777:ffa44a5159e0
313 gtk_color_selection_get_current_color(colorsel, &text_color); 313 gtk_color_selection_get_current_color(colorsel, &text_color);
314 g_snprintf(open_tag, 23, "#%02X%02X%02X", 314 g_snprintf(open_tag, 23, "#%02X%02X%02X",
315 text_color.red / 256, 315 text_color.red / 256,
316 text_color.green / 256, 316 text_color.green / 256,
317 text_color.blue / 256); 317 text_color.blue / 256);
318 gtk_imhtml_toggle_backcolor(GTK_IMHTML(toolbar->imhtml), open_tag); 318 if (gtk_text_buffer_get_selection_bounds(GTK_IMHTML(toolbar->imhtml)->text_buffer, NULL, NULL))
319 gtk_imhtml_toggle_backcolor(GTK_IMHTML(toolbar->imhtml), open_tag);
320 else
321 gtk_imhtml_toggle_background(GTK_IMHTML(toolbar->imhtml), open_tag);
319 322
320 g_free(open_tag); 323 g_free(open_tag);
321 cancel_toolbar_bgcolor(NULL, toolbar); 324 cancel_toolbar_bgcolor(NULL, toolbar);
322 } 325 }
323 326