diff options
author | Milan Crha <mcrha@redhat.com> | 2013-04-23 20:59:09 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-04-23 20:59:09 +0800 |
commit | b064d64be7e2e9444721beb7a02038f638edab4c (patch) | |
tree | 35183e5a83eb22078db23835538ea9e07b4b6d2a /mail | |
parent | bd48b0a0f42696d2e8cb5eba10a3e0c123e9395d (diff) | |
download | gsoc2013-evolution-b064d64be7e2e9444721beb7a02038f638edab4c.tar gsoc2013-evolution-b064d64be7e2e9444721beb7a02038f638edab4c.tar.gz gsoc2013-evolution-b064d64be7e2e9444721beb7a02038f638edab4c.tar.bz2 gsoc2013-evolution-b064d64be7e2e9444721beb7a02038f638edab4c.tar.lz gsoc2013-evolution-b064d64be7e2e9444721beb7a02038f638edab4c.tar.xz gsoc2013-evolution-b064d64be7e2e9444721beb7a02038f638edab4c.tar.zst gsoc2013-evolution-b064d64be7e2e9444721beb7a02038f638edab4c.zip |
[EMailFormatter] Use GdkRGBA and GtkStyleContext to get theme colors
It could happen that header text color had been picked white one time,
but the other time black as expected (for me usually when I started
Evolution in Calendar and moved to Mail view, the header text color
was white, while when starting in Mail view it was black). The change
to use GtkStyleContext is there only as a cleanup from deprecated
GtkStyle, and to make things easier too, because both GtkStyle
and the GtkStyleContext had set white color for some reason.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-display.c | 21 | ||||
-rw-r--r-- | mail/em-utils.c | 5 |
2 files changed, 10 insertions, 16 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 6794b144a4..7f6063b07d 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -195,15 +195,11 @@ mail_display_image_exists_in_cache (const gchar *image_uri) static void mail_display_update_formatter_colors (EMailDisplay *display) { - GtkStyle *style; - GtkStateType state; - if (display->priv->formatter == NULL) return; - style = gtk_widget_get_style (GTK_WIDGET (display)); - state = gtk_widget_get_state (GTK_WIDGET (display)); - e_mail_formatter_set_style (display->priv->formatter, style, state); + e_mail_formatter_update_style (display->priv->formatter, + gtk_widget_get_state_flags (GTK_WIDGET (display))); } static void @@ -1371,16 +1367,15 @@ mail_display_realize (GtkWidget *widget) } static void -mail_display_style_set (GtkWidget *widget, - GtkStyle *previous_style) +mail_display_style_updated (GtkWidget *widget) { EMailDisplay *display = E_MAIL_DISPLAY (widget); mail_display_update_formatter_colors (display); - /* Chain up to parent's style_set() method. */ + /* Chain up to parent's style_updated() method. */ GTK_WIDGET_CLASS (e_mail_display_parent_class)-> - style_set (widget, previous_style); + style_updated (widget); } static gboolean @@ -1490,7 +1485,7 @@ e_mail_display_class_init (EMailDisplayClass *class) widget_class = GTK_WIDGET_CLASS (class); widget_class->realize = mail_display_realize; - widget_class->style_set = mail_display_style_set; + widget_class->style_updated = mail_display_style_updated; widget_class->button_press_event = mail_display_button_press_event; web_view_class = E_WEB_VIEW_CLASS (class); @@ -1971,11 +1966,11 @@ e_mail_display_set_status (EMailDisplay *display, " </table>\n" "</body>\n" "</html>\n", - e_color_to_value ((GdkColor *) + e_rgba_to_value ( e_mail_formatter_get_color ( display->priv->formatter, E_MAIL_FORMATTER_COLOR_CONTENT)), - e_color_to_value ((GdkColor *) + e_rgba_to_value ( e_mail_formatter_get_color ( display->priv->formatter, E_MAIL_FORMATTER_COLOR_TEXT)), diff --git a/mail/em-utils.c b/mail/em-utils.c index 0da08fa324..052af8c5ae 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1284,9 +1284,8 @@ em_utils_message_to_html (CamelSession *session, camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (mem), buf); formatter = e_mail_formatter_quote_new (credits, flags); - e_mail_formatter_set_style (formatter, - gtk_widget_get_style (GTK_WIDGET (window)), - gtk_widget_get_state (GTK_WIDGET (window))); + e_mail_formatter_update_style (formatter, + gtk_widget_get_state_flags (GTK_WIDGET (window))); if (parts_list == NULL) { GSettings *settings; |