[evolution] Bug 770086 - Mail display: Poor contrast in backdrop mode
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 770086 - Mail display: Poor contrast in backdrop mode
- Date: Thu, 18 Aug 2016 15:52:55 +0000 (UTC)
commit cdb4c1d4feb951a33e48b2e4838e5de1598c204b
Author: Milan Crha <mcrha redhat com>
Date: Thu Aug 18 17:50:56 2016 +0200
Bug 770086 - Mail display: Poor contrast in backdrop mode
e-util/e-web-view.c | 14 ++------------
em-format/e-mail-formatter.c | 38 ++++++++++++--------------------------
2 files changed, 14 insertions(+), 38 deletions(-)
---
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index 9c58739..164c10c 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -656,18 +656,11 @@ style_updated_cb (EWebView *web_view)
GdkRGBA color;
gchar *color_value;
gchar *style;
- GtkStateFlags state_flags;
GtkStyleContext *style_context;
- gboolean backdrop;
- state_flags = gtk_widget_get_state_flags (GTK_WIDGET (web_view));
style_context = gtk_widget_get_style_context (GTK_WIDGET (web_view));
- backdrop = (state_flags & GTK_STATE_FLAG_BACKDROP) != 0;
- if (gtk_style_context_lookup_color (
- style_context,
- backdrop ? "theme_unfocused_base_color" : "theme_base_color",
- &color))
+ if (gtk_style_context_lookup_color (style_context, "theme_base_color", &color))
color_value = g_strdup_printf ("#%06x", e_rgba_to_value (&color));
else
color_value = g_strdup (E_UTILS_DEFAULT_THEME_BASE_COLOR);
@@ -683,10 +676,7 @@ style_updated_cb (EWebView *web_view)
g_free (color_value);
g_free (style);
- if (gtk_style_context_lookup_color (
- style_context,
- backdrop ? "theme_unfocused_fg_color" : "theme_fg_color",
- &color))
+ if (gtk_style_context_lookup_color (style_context, "theme_fg_color", &color))
color_value = g_strdup_printf ("#%06x", e_rgba_to_value (&color));
else
color_value = g_strdup (E_UTILS_DEFAULT_THEME_FG_COLOR);
diff --git a/em-format/e-mail-formatter.c b/em-format/e-mail-formatter.c
index 13e68c5..dbd47e2 100644
--- a/em-format/e-mail-formatter.c
+++ b/em-format/e-mail-formatter.c
@@ -498,7 +498,6 @@ mail_formatter_update_style (EMailFormatter *formatter,
GtkStyleContext *style_context;
GtkWidgetPath *widget_path;
GdkRGBA rgba;
- gboolean backdrop;
g_object_freeze_notify (G_OBJECT (formatter));
@@ -506,15 +505,11 @@ mail_formatter_update_style (EMailFormatter *formatter,
widget_path = gtk_widget_path_new ();
gtk_widget_path_append_type (widget_path, GTK_TYPE_WINDOW);
gtk_style_context_set_path (style_context, widget_path);
- backdrop = (state & GTK_STATE_FLAG_BACKDROP) != 0;
- if (!gtk_style_context_lookup_color (
- style_context,
- backdrop ? "theme_unfocused_bg_color" : "theme_bg_color",
- &rgba))
+ if (!gtk_style_context_lookup_color (style_context, "theme_bg_color", &rgba))
gdk_rgba_parse (&rgba, E_UTILS_DEFAULT_THEME_BG_COLOR);
- e_mail_formatter_set_color (
- formatter, E_MAIL_FORMATTER_COLOR_BODY, &rgba);
+
+ e_mail_formatter_set_color (formatter, E_MAIL_FORMATTER_COLOR_BODY, &rgba);
rgba.red *= 0.8;
rgba.green *= 0.8;
@@ -522,29 +517,20 @@ mail_formatter_update_style (EMailFormatter *formatter,
e_mail_formatter_set_color (
formatter, E_MAIL_FORMATTER_COLOR_FRAME, &rgba);
- if (!gtk_style_context_lookup_color (
- style_context,
- backdrop ? "theme_unfocused_fg_color" : "theme_fg_color",
- &rgba))
+ if (!gtk_style_context_lookup_color (style_context, "theme_fg_color", &rgba))
gdk_rgba_parse (&rgba, E_UTILS_DEFAULT_THEME_FG_COLOR);
- e_mail_formatter_set_color (
- formatter, E_MAIL_FORMATTER_COLOR_HEADER, &rgba);
- if (!gtk_style_context_lookup_color (
- style_context,
- backdrop ? "theme_unfocused_base_color" : "theme_base_color",
- &rgba))
+ e_mail_formatter_set_color (formatter, E_MAIL_FORMATTER_COLOR_HEADER, &rgba);
+
+ if (!gtk_style_context_lookup_color (style_context, "theme_base_color", &rgba))
gdk_rgba_parse (&rgba, E_UTILS_DEFAULT_THEME_BASE_COLOR);
- e_mail_formatter_set_color (
- formatter, E_MAIL_FORMATTER_COLOR_CONTENT, &rgba);
- if (!gtk_style_context_lookup_color (
- style_context,
- backdrop ? "theme_unfocused_fg_color" : "theme_fg_color",
- &rgba))
+ e_mail_formatter_set_color (formatter, E_MAIL_FORMATTER_COLOR_CONTENT, &rgba);
+
+ if (!gtk_style_context_lookup_color (style_context, "theme_fg_color", &rgba))
gdk_rgba_parse (&rgba, E_UTILS_DEFAULT_THEME_FG_COLOR);
- e_mail_formatter_set_color (
- formatter, E_MAIL_FORMATTER_COLOR_TEXT, &rgba);
+
+ e_mail_formatter_set_color (formatter, E_MAIL_FORMATTER_COLOR_TEXT, &rgba);
gtk_widget_path_free (widget_path);
g_object_unref (style_context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]