Don't hardcode link colour in the details page Hardcoding a foreground colour but not the corresponding background colour (or viceversa) is braindamaged and leads to unreadable text depending on the active theme. Use the theme's link colour instead. --- gucharmap/gucharmap-charmap.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) Index: b/gucharmap/gucharmap-charmap.c =================================================================== --- a/gucharmap/gucharmap-charmap.c +++ b/gucharmap/gucharmap-charmap.c @@ -547,12 +547,18 @@ insert_codepoint (GucharmapCharmap *char GtkTextIter *iter, gunichar uc) { - gchar *str; + GucharmapCharmapPrivate *priv = charmap->priv; GtkTextTag *tag; + GtkStyleContext *stylectx; + gchar *str; char buf[7]; GUnicodeType t; gboolean is_graph, is_Mn; char nbsp[3] = "\302\240"; /* U+00A0 NO-BREAK SPACE */ + GdkRGBA link_colour = {0, 0, 1, 1}; /* "blue" */ + + stylectx = gtk_widget_get_style_context (GTK_WIDGET (priv->details_view)); + gtk_style_context_get_color (stylectx, GTK_STATE_FLAG_LINK, &link_colour); t = g_unichar_type (uc); is_Mn = t == G_UNICODE_NON_SPACING_MARK /* Mn */; @@ -569,9 +575,10 @@ insert_codepoint (GucharmapCharmap *char gucharmap_get_unicode_name (uc)); tag = gtk_text_buffer_create_tag (buffer, NULL, - "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); + g_object_set (tag, "foreground-rgba", &link_colour, NULL); + /* add one so that zero is the "nothing" value, since U+0000 is a character */ g_object_set_data (G_OBJECT (tag), "link-character", GUINT_TO_POINTER (uc + 1));