src/gtkimhtmltoolbar.c

changeset 10777
5a9df3199615
parent 10732
5e314ab498bf
child 10814
7e17cb56b019
equal deleted inserted replaced
10776:b474d64f94ac 10777:5a9df3199615
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

mercurial