56 lines
1.9 KiB
Diff
56 lines
1.9 KiB
Diff
diff -urp libsexy-0.1.11.OLD/libsexy/sexy-url-label.c libsexy-0.1.11/libsexy/sexy-url-label.c
|
|
--- libsexy-0.1.11.OLD/libsexy/sexy-url-label.c 2007-03-17 23:30:00.000000000 -0400
|
|
+++ libsexy-0.1.11/libsexy/sexy-url-label.c 2008-09-21 18:32:01.000000000 -0400
|
|
@@ -516,7 +516,11 @@ copy_link_activate_cb(GtkMenuItem *menu_
|
|
|
|
clipboard = gtk_widget_get_clipboard(GTK_WIDGET(url_label),
|
|
GDK_SELECTION_PRIMARY);
|
|
+ gtk_clipboard_set_text(clipboard, priv->active_link->url,
|
|
+ strlen(priv->active_link->url));
|
|
|
|
+ clipboard = gtk_widget_get_clipboard(GTK_WIDGET(url_label),
|
|
+ GDK_SELECTION_CLIPBOARD);
|
|
gtk_clipboard_set_text(clipboard, priv->active_link->url,
|
|
strlen(priv->active_link->url));
|
|
}
|
|
@@ -634,6 +638,9 @@ start_element_handler(GMarkupParseContex
|
|
int line_number;
|
|
int char_number;
|
|
int i;
|
|
+#if GTK_CHECK_VERSION(2, 10, 0)
|
|
+ GdkColor *link_color = NULL;
|
|
+#endif
|
|
|
|
g_markup_parse_context_get_position(context, &line_number,
|
|
&char_number);
|
|
@@ -677,8 +684,28 @@ start_element_handler(GMarkupParseContex
|
|
return;
|
|
}
|
|
|
|
+#if GTK_CHECK_VERSION(2, 10, 0)
|
|
+ gtk_widget_ensure_style(GTK_WIDGET(url_label));
|
|
+ gtk_widget_style_get(GTK_WIDGET(url_label),
|
|
+ "link-color", &link_color,
|
|
+ NULL);
|
|
+ if (link_color != NULL)
|
|
+ {
|
|
+ g_string_append_printf(priv->temp_markup_result,
|
|
+ "<span color=\"#%04x%04x%04x\" underline=\"single\">",
|
|
+ link_color->red,
|
|
+ link_color->green,
|
|
+ link_color->blue);
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ g_string_append(priv->temp_markup_result,
|
|
+ "<span color=\"blue\" underline=\"single\">");
|
|
+ }
|
|
+#else
|
|
g_string_append(priv->temp_markup_result,
|
|
- "<span color=\"blue\" underline=\"single\">");
|
|
+ "<span color=\"blue\" underline=\"single\">");
|
|
+#endif
|
|
|
|
priv->urls = g_list_append(priv->urls, g_strdup(url));
|
|
}
|