src/gtkimhtml.c

changeset 9008
0be1d8921114
parent 9007
87c8402bc0e3
child 9025
e49a72896270
equal deleted inserted replaced
9007:87c8402bc0e3 9008:0be1d8921114
3453 if (url) { 3453 if (url) {
3454 g_snprintf(str, sizeof(str), "LINK %d", linkno++); 3454 g_snprintf(str, sizeof(str), "LINK %d", linkno++);
3455 str[47] = '\0'; 3455 str[47] = '\0';
3456 3456
3457 gtk_widget_style_get(GTK_WIDGET(imhtml), "hyperlink-color", &color, NULL); 3457 gtk_widget_style_get(GTK_WIDGET(imhtml), "hyperlink-color", &color, NULL);
3458 if (color) 3458 if (color) {
3459 imhtml->edit.link = linktag = gtk_text_buffer_create_tag(imhtml->text_buffer, str, "foreground-gdk", color, "underline", PANGO_UNDERLINE_SINGLE, NULL); 3459 imhtml->edit.link = linktag = gtk_text_buffer_create_tag(imhtml->text_buffer, str, "foreground-gdk", color, "underline", PANGO_UNDERLINE_SINGLE, NULL);
3460 else 3460 gdk_color_free(color);
3461 } else {
3461 imhtml->edit.link = linktag = gtk_text_buffer_create_tag(imhtml->text_buffer, str, "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); 3462 imhtml->edit.link = linktag = gtk_text_buffer_create_tag(imhtml->text_buffer, str, "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL);
3463 }
3462 g_object_set_data_full(G_OBJECT(linktag), "link_url", g_strdup(url), g_free); 3464 g_object_set_data_full(G_OBJECT(linktag), "link_url", g_strdup(url), g_free);
3463 g_signal_connect(G_OBJECT(linktag), "event", G_CALLBACK(tag_event), NULL); 3465 g_signal_connect(G_OBJECT(linktag), "event", G_CALLBACK(tag_event), NULL);
3464 3466
3465 if (imhtml->editable && gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, &start, &end)) { 3467 if (imhtml->editable && gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, &start, &end)) {
3466 remove_font_link(imhtml, &start, &end, FALSE); 3468 remove_font_link(imhtml, &start, &end, FALSE);

mercurial