Commit ef72ebbe authored by Morten Welinder's avatar Morten Welinder

GUI: Dead kittens.

link-color as a style property ceased to work.
parent 20cff62f
......@@ -3,6 +3,7 @@ Gnumeric 1.12.42
Morten:
* Plug leaks.
* Introspection fixes.
* Work around gtk+ breakage re. link colors.
--------------------------------------------------------------------------
Gnumeric 1.12.41
......
......@@ -577,12 +577,11 @@ make_link (GtkTextBuffer *description, GtkWidget *target, const char *name,
(gtk_text_buffer_get_tag_table (description), name);
if (!link) {
GdkColor *link_color = NULL;
GdkRGBA link_color;
char *link_color_text;
gtk_widget_style_get (target, "link-color", &link_color, NULL);
link_color_text = gdk_color_to_string (link_color);
gdk_color_free (link_color);
gnm_get_link_color (target, &link_color);
link_color_text = gdk_rgba_to_string (&link_color);
link = gtk_text_buffer_create_tag
(description, name,
......
......@@ -29,6 +29,7 @@
#include "command-context-stderr.h"
#include "gnm-plugin.h"
#include "gutils.h"
#include "gui-util.h"
#include <goffice/goffice.h>
#include <glib.h>
......@@ -1034,16 +1035,16 @@ gnm_func_convert_markup_to_pango (char const *desc, GtkWidget *target)
{
GString *str;
gchar *markup, *at;
GdkColor *link_color = NULL;
GdkRGBA link_color;
PangoColor pg;
char *link_color_text, *span_text;
size_t span_text_len;
gtk_widget_style_get (target, "link-color", &link_color, NULL);
if (link_color) {
link_color_text = gdk_color_to_string (link_color);
gdk_color_free (link_color);
} else
link_color_text = g_strdup ("blue");
gnm_get_link_color (target, &link_color);
pg.red = 65535 * link_color.red;
pg.green = 65535 * link_color.green;
pg.blue = 65535 * link_color.blue;
link_color_text = pango_color_to_string (&pg);
span_text = g_strdup_printf ("<span foreground=\"%s\">",
link_color_text);
span_text_len = strlen (span_text);
......
......@@ -1359,4 +1359,11 @@ gnm_style_context_get_color (GtkStyleContext *context,
gtk_style_context_restore (context);
}
void
gnm_get_link_color (GtkWidget *widget, GdkRGBA *res)
{
GtkStyleContext *ctxt = gtk_widget_get_style_context (widget);
gnm_style_context_get_color (ctxt, GTK_STATE_FLAG_LINK, res);
}
// ----------------------------------------------------------------------------
......@@ -187,6 +187,8 @@ void gnm_style_context_get_color (GtkStyleContext *context,
GtkStateFlags state,
GdkRGBA *color);
void gnm_get_link_color (GtkWidget *widget, GdkRGBA *res);
G_END_DECLS
#endif /* _GNM_GUI_UTIL_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment