8 Star 0 Fork 5

src-anolis-os/evolution

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webkitgtk-2.36.0-dark-theme.patch 2.39 KB
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2023-05-15 18:07 . update to evolution-3.40.4-6.el9
From ac15857f14eecd83a3a1950588a2f1edb9cb70de Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Fri, 18 Mar 2022 09:45:20 +0100
Subject: [PATCH] I#1835 - Mail: Preview uses wrong colors for HTML mail with
dark theme
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1835
---
data/webkit/e-web-view.js | 12 ++++++++++--
src/em-format/e-mail-formatter-text-html.c | 2 +-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/data/webkit/e-web-view.js b/data/webkit/e-web-view.js
index 7f47fe4b26..a8f99c4668 100644
--- a/data/webkit/e-web-view.js
+++ b/data/webkit/e-web-view.js
@@ -695,8 +695,16 @@ Evo.initialize = function(elem)
if (doc.documentElement.style.getPropertyValue("color") == "" ||
doc.documentElement.style.getPropertyValue("color") == "text") {
- doc.documentElement.style.setProperty("color", "inherit");
- doc.documentElement.style.setProperty("background-color", "inherit");
+ if (doc.defaultView && doc.defaultView.frameElement && !doc.defaultView.frameElement.hasAttribute("x-e-unset-colors") &&
+ doc.defaultView.frameElement.ownerDocument &&
+ doc.defaultView.frameElement.ownerDocument.defaultView &&
+ doc.defaultView.frameElement.ownerDocument.defaultView.window) {
+ var style = doc.defaultView.frameElement.ownerDocument.defaultView.window.getComputedStyle(doc.defaultView.frameElement);
+ if (style) {
+ doc.documentElement.style.setProperty("color", style.color);
+ doc.documentElement.style.setProperty("background-color", style.backgroundColor);
+ }
+ }
}
elems = doc.querySelectorAll("input, textarea, select, button, label");
diff --git a/src/em-format/e-mail-formatter-text-html.c b/src/em-format/e-mail-formatter-text-html.c
index 708c29a5e4..8a938212ff 100644
--- a/src/em-format/e-mail-formatter-text-html.c
+++ b/src/em-format/e-mail-formatter-text-html.c
@@ -369,7 +369,7 @@ emfe_text_html_format (EMailFormatterExtension *extension,
e_mail_part_get_id (part),
e_mail_part_get_id (part),
e_mail_part_get_frame_security_style (part),
- g_settings_get_boolean (settings, "preview-unset-html-colors") ? "x-e-unset-colors=\"1\"" : "style=\"background-color: #ffffff;\"");
+ g_settings_get_boolean (settings, "preview-unset-html-colors") ? "x-e-unset-colors=\"1\"" : "style=\"background-color:white; color:black;\"");
g_output_stream_write_all (
stream, str, strlen (str),
--
GitLab
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/evolution.git
git@gitee.com:src-anolis-os/evolution.git
src-anolis-os
evolution
evolution
a8

搜索帮助