aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-html-editor-page-dialog.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-07-07 18:51:41 +0800
committerMilan Crha <mcrha@redhat.com>2014-07-07 18:51:41 +0800
commit50bda1bad222082488d3d9bc9fe1d0fb3867e974 (patch)
tree27042fc0a39e4a7f79d920bae88cb29aa5677d10 /e-util/e-html-editor-page-dialog.c
parent534864b39850ea2354b87419da6dc77538867756 (diff)
downloadgsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.gz
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.bz2
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.lz
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.xz
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.zst
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.zip
Replace GtkStyle usages with GtkStyleContext
This makes evolution depend on theme-defined named colors, namely: theme_bg_color theme_base_color theme_fg_color theme_text_color theme_selected_bg_color theme_selected_fg_color theme_unfocused_selected_bg_color theme_unfocused_selected_fg_color If it's not defined, then a fallback color is used, in the worse case one of the fallbacks defined in evolution itself.
Diffstat (limited to 'e-util/e-html-editor-page-dialog.c')
-rw-r--r--e-util/e-html-editor-page-dialog.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/e-util/e-html-editor-page-dialog.c b/e-util/e-html-editor-page-dialog.c
index 27552576c6..b01e15b0b0 100644
--- a/e-util/e-html-editor-page-dialog.c
+++ b/e-util/e-html-editor-page-dialog.c
@@ -322,18 +322,8 @@ html_editor_page_dialog_show (GtkWidget *widget)
tmp = webkit_dom_html_body_element_get_text (
WEBKIT_DOM_HTML_BODY_ELEMENT (body));
- if (!tmp || !*tmp) {
- GdkColor *color;
- GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (view));
- color = &style->text[GTK_STATE_NORMAL];
-
- 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);
- }
+ if (!tmp || !*tmp || !gdk_rgba_parse (&rgba, tmp))
+ e_utils_get_theme_color (widget, "theme_text_color", E_UTILS_DEFAULT_THEME_TEXT_COLOR, &rgba);
g_free (tmp);
e_color_combo_set_current_color (
E_COLOR_COMBO (dialog->priv->text_color_picker), &rgba);
@@ -358,19 +348,8 @@ html_editor_page_dialog_show (GtkWidget *widget)
tmp = webkit_dom_html_body_element_get_bg_color (
WEBKIT_DOM_HTML_BODY_ELEMENT (body));
- if (!tmp || !*tmp) {
- GdkColor *color;
- GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (view));
- color = &style->base[GTK_STATE_NORMAL];
-
- 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);
- }
+ if (!tmp || !*tmp || !gdk_rgba_parse (&rgba, tmp))
+ e_utils_get_theme_color (widget, "theme_base_color", E_UTILS_DEFAULT_THEME_BASE_COLOR, &rgba);
g_free (tmp);
e_color_combo_set_current_color (
E_COLOR_COMBO (dialog->priv->background_color_picker), &rgba);