Accepting request 89176 from home:FunkyPenguin:branches:GNOME:Factory

- Add evolution-text-colour.patch to fix bgo#660738

OBS-URL: https://build.opensuse.org/request/show/89176
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/evolution?expand=0&rev=147
This commit is contained in:
Vincent Untz 2011-10-24 20:43:07 +00:00 committed by Git OBS Bridge
parent aafecc7b41
commit a8533615c6
3 changed files with 135 additions and 0 deletions

127
evolution-text-colour.patch Normal file
View File

@ -0,0 +1,127 @@
From c8abdeddfb0bcad2f53dd75d618c462ad3b7ad28 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Fri, 21 Oct 2011 12:13:01 +0000
Subject: Bug #660738 - Font changes ignored since 3.2
---
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 8ededee..136f8ec 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -1431,9 +1431,19 @@ e_binding_transform_color_to_string (GBinding *binding,
g_return_val_if_fail (G_IS_BINDING (binding), FALSE);
color = g_value_get_boxed (source_value);
- string = gdk_color_to_string (color);
- g_value_set_string (target_value, string);
- g_free (string);
+ if (!color) {
+ g_value_set_string (target_value, "");
+ } else {
+ /* encode color manually, because css styles expect colors in #rrggbb,
+ not in #rrrrggggbbbb, which is a result of gdk_color_to_string()
+ */
+ string = g_strdup_printf ("#%02x%02x%02x",
+ (gint) color->red * 256 / 65536,
+ (gint) color->green * 256 / 65536,
+ (gint) color->blue * 256 / 65536);
+ g_value_set_string (target_value, string);
+ g_free (string);
+ }
return TRUE;
}
diff --git a/modules/mail/e-mail-config-web-view.c b/modules/mail/e-mail-config-web-view.c
index b8a755b..d873a54 100644
--- a/modules/mail/e-mail-config-web-view.c
+++ b/modules/mail/e-mail-config-web-view.c
@@ -20,6 +20,9 @@
#include <config.h>
#endif
+#include <stdio.h>
+#include <string.h>
+
#include "e-mail-config-web-view.h"
#include <shell/e-shell.h>
@@ -41,6 +44,24 @@ struct _EMailConfigWebViewClass {
static gpointer parent_class;
+/* replaces content of color string */
+static void
+fix_color_string (gchar *color_string)
+{
+ GdkColor color;
+
+ if (!color_string || strlen (color_string) < 13)
+ return;
+
+ if (!gdk_color_parse (color_string, &color))
+ return;
+
+ sprintf (color_string, "#%02x%02x%02x",
+ (gint) color.red * 256 / 65536,
+ (gint) color.green * 256 / 65536,
+ (gint) color.blue * 256 / 65536);
+}
+
static void
mail_config_web_view_load_style (EMailConfigWebView *extension)
{
@@ -77,13 +98,16 @@ mail_config_web_view_load_style (EMailConfigWebView *extension)
buffer = g_string_new ("EWebView {\n");
+ fix_color_string (citation_color);
+ fix_color_string (spell_color);
+
if (custom_fonts && variable_font != NULL)
g_string_append_printf (
buffer, " font: %s;\n", variable_font);
if (custom_fonts && monospace_font != NULL)
g_string_append_printf (
- buffer, " -GtkHTML-fixed-font-name: %s;\n",
+ buffer, " -GtkHTML-fixed-font-name: '%s';\n",
monospace_font);
if (mark_citations && citation_color != NULL)
@@ -93,7 +117,7 @@ mail_config_web_view_load_style (EMailConfigWebView *extension)
if (spell_color != NULL)
g_string_append_printf (
- buffer, " -GtkHTML-spell-error-color: %s\n",
+ buffer, " -GtkHTML-spell-error-color: %s;\n",
spell_color);
g_string_append (buffer, "}\n");
@@ -112,6 +136,9 @@ mail_config_web_view_load_style (EMailConfigWebView *extension)
g_free (variable_font);
g_free (citation_color);
g_free (spell_color);
+
+ gtk_style_context_invalidate (
+ gtk_widget_get_style_context (GTK_WIDGET (e_extension_get_extensible (E_EXTENSION (extension)))));
}
static void
@@ -142,13 +169,13 @@ mail_config_web_view_realize (GtkWidget *widget,
widget, "magic-smileys",
G_BINDING_SYNC_CREATE);
- mail_config_web_view_load_style (extension);
-
gtk_style_context_add_provider (
gtk_widget_get_style_context (widget),
GTK_STYLE_PROVIDER (extension->css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ mail_config_web_view_load_style (extension);
+
/* Reload the style sheet when certain settings change. */
g_signal_connect_swapped (
--
cgit v0.9.0.2

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Oct 24 13:57:36 UTC 2011 - awafaa@opensuse.org
- Add evolution-text-colour.patch to fix bgo#660738
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 21 11:30:55 UTC 2011 - vuntz@opensuse.org Fri Oct 21 11:30:55 UTC 2011 - vuntz@opensuse.org

View File

@ -85,6 +85,8 @@ Patch19: bnc-435722-book-uri-long.patch
Patch35: bnc-210959-evo-accept-ics.patch Patch35: bnc-210959-evo-accept-ics.patch
# PATCH-FIX-UPSTREAM evolution-GtkHVBox.patch bgo#656143 dimstar@opensuse.org -- Stop using deprecated Gtk[HV]Box(Class)?. # PATCH-FIX-UPSTREAM evolution-GtkHVBox.patch bgo#656143 dimstar@opensuse.org -- Stop using deprecated Gtk[HV]Box(Class)?.
Patch36: evolution-GtkHVBox.patch Patch36: evolution-GtkHVBox.patch
# PATCH-FIX-UPSTREAM evolution-text-colour.patch bgo#660738 awafaa@opensuse.org -- Fix broken text colour highlighting.
Patch37: evolution-text-colour.patch
Url: http://gnome.org/projects/evolution/ Url: http://gnome.org/projects/evolution/
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Recommends: %{name}-lang Recommends: %{name}-lang
@ -177,6 +179,7 @@ translation-update-upstream
%patch19 %patch19
%patch35 %patch35
%patch36 -p1 %patch36 -p1
%patch37 -p1
%build %build
autoreconf -f -i autoreconf -f -i