[evolution] EHTMLEditorPageDialog - Dialog shows wrong link color
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EHTMLEditorPageDialog - Dialog shows wrong link color
- Date: Mon, 9 Mar 2015 06:35:20 +0000 (UTC)
commit 2dab9b12fa3fd23989002f1bdc3ad7cf6da5c7db
Author: Tomas Popela <tpopela redhat com>
Date: Sat Mar 7 10:55:47 2015 +0100
EHTMLEditorPageDialog - Dialog shows wrong link color
e-util/e-html-editor-page-dialog.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/e-util/e-html-editor-page-dialog.c b/e-util/e-html-editor-page-dialog.c
index ca5494b..0e9c8de 100644
--- a/e-util/e-html-editor-page-dialog.c
+++ b/e-util/e-html-editor-page-dialog.c
@@ -361,14 +361,24 @@ html_editor_page_dialog_show (GtkWidget *widget)
tmp = webkit_dom_html_body_element_get_link (
WEBKIT_DOM_HTML_BODY_ELEMENT (body));
if (!tmp || !*tmp) {
- GdkColor color;
- gtk_widget_style_get (
- GTK_WIDGET (view), "link-color", &color, NULL);
-
- rgba.alpha = 1;
- rgba.red = ((gdouble) color.red) / G_MAXUINT16;
- rgba.green = ((gdouble) color.green) / G_MAXUINT16;
- rgba.blue = ((gdouble) color.blue) / G_MAXUINT16;
+ GdkColor *color = NULL;
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (view));
+ gtk_style_context_get_style (
+ context, "link-color", &color, NULL);
+
+ if (color == NULL) {
+ rgba.alpha = 1;
+ rgba.red = 0;
+ rgba.green = 0;
+ rgba.blue = 1;
+ } else {
+ rgba.alpha = 1;
+ rgba.red = ((gdouble) color->red) / G_MAXUINT16;
+ rgba.green = ((gdouble) color->green) / G_MAXUINT16;
+ rgba.blue = ((gdouble) color->blue) / G_MAXUINT16;
+ }
} else {
gdk_rgba_parse (&rgba, tmp);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]