[evolution/wip/webkit-composer: 862/966] EEditorWidget: Refactor citation colors
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit-composer: 862/966] EEditorWidget: Refactor citation colors
- Date: Wed, 23 Apr 2014 11:05:54 +0000 (UTC)
commit 817beeb50df706fa4ff7e0f0ad4332a3392c518d
Author: Tomas Popela <tpopela redhat com>
Date: Tue Mar 4 15:32:12 2014 +0100
EEditorWidget: Refactor citation colors
e-util/e-editor-widget.c | 102 ++++++++++++++++++++++++++++++++--------------
1 files changed, 71 insertions(+), 31 deletions(-)
---
diff --git a/e-util/e-editor-widget.c b/e-util/e-editor-widget.c
index 04ec487..57d1354 100644
--- a/e-util/e-editor-widget.c
+++ b/e-util/e-editor-widget.c
@@ -4659,6 +4659,36 @@ e_editor_widget_remove_embed_styles (EEditorWidget *widget)
NULL);
}
+static const gchar *
+citation_color_level_1 (void)
+{
+ return "rgb(114,159,207)"; /* Sky Blue 1 */
+}
+
+static const gchar *
+citation_color_level_2 (void)
+{
+ return "rgb(173,127,168)"; /* Plum 1 */
+}
+
+static const gchar *
+citation_color_level_3 (void)
+{
+ return "rgb(138,226,52)"; /* Chameleon 1 */
+}
+
+static const gchar *
+citation_color_level_4 (void)
+{
+ return "rgb(252,175,62)"; /* Orange 1 */
+}
+
+static const gchar *
+citation_color_level_5 (void)
+{
+ return "rgb(233,185,110)"; /* Chocolate 1 */
+}
+
/**
* e_editor_widget_update_fonts:
* @widget: an #EEditorWidget
@@ -4794,7 +4824,7 @@ e_editor_widget_update_fonts (EEditorWidget *widget)
" -webkit-margin-after: 0em; \n"
"}\n");
- g_string_append(
+ g_string_append (
stylesheet,
"blockquote "
"{\n"
@@ -4813,41 +4843,45 @@ e_editor_widget_update_fonts (EEditorWidget *widget)
" color: #737373 !important;\n"
"}\n");
- g_string_append (
+ g_string_append_printf (
stylesheet,
".quote_character "
"{\n"
- " color: rgb(114,159,207);\n" /* Sky Blue 1 */
- "}\n");
+ " color: %s;\n"
+ "}\n",
+ citation_color_level_1 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
".quote_character+"
".quote_character"
"{\n"
- " color: rgb(173,127,168);\n" /* Plum 1 */
- "}\n");
+ " color: %s;\n"
+ "}\n",
+ citation_color_level_2 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
".quote_character+"
".quote_character+"
".quote_character"
"{\n"
- " color: rgb(138,226,52);\n" /* Chameleon 1 */
- "}\n");
+ " color: %s;\n"
+ "}\n",
+ citation_color_level_3 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
".quote_character+"
".quote_character+"
".quote_character+"
".quote_character"
"{\n"
- " color: rgb(252,175,62);\n" /* Orange 1 */
- "}\n");
+ " color: %s;\n"
+ "}\n",
+ citation_color_level_4 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
".quote_character+"
".quote_character+"
@@ -4855,8 +4889,9 @@ e_editor_widget_update_fonts (EEditorWidget *widget)
".quote_character+"
".quote_character"
"{\n"
- " color: rgb(233,185,110);\n" /* Chocolate 1 */
- "}\n");
+ " color: %s;\n"
+ "}\n",
+ citation_color_level_5 ());
g_string_append (
stylesheet,
@@ -4871,41 +4906,45 @@ e_editor_widget_update_fonts (EEditorWidget *widget)
/* Block quote border colors are borrowed from Thunderbird. */
- g_string_append (
+ g_string_append_printf (
stylesheet,
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"{\n"
- " border-color: rgb(114,159,207);\n" /* Sky Blue 1 */
- "}\n");
+ " border-color: %s;\n"
+ "}\n",
+ citation_color_level_1 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"{\n"
- " border-color: rgb(173,127,168);\n" /* Plum 1 */
- "}\n");
+ " border-color: %s;\n"
+ "}\n",
+ citation_color_level_2 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"{\n"
- " border-color: rgb(138,226,52);\n" /* Chameleon 1 */
- "}\n");
+ " border-color: %s;\n"
+ "}\n",
+ citation_color_level_3 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"{\n"
- " border-color: rgb(252,175,62);\n" /* Orange 1 */
- "}\n");
+ " border-color: %s;\n"
+ "}\n",
+ citation_color_level_4 ());
- g_string_append (
+ g_string_append_printf (
stylesheet,
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
@@ -4913,8 +4952,9 @@ e_editor_widget_update_fonts (EEditorWidget *widget)
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"blockquote[type=cite]:not(.-x-evo-plaintext-quoted) "
"{\n"
- " border-color: rgb(233,185,110);\n" /* Chocolate 1 */
- "}\n");
+ " border-color: %s;\n"
+ "}\n",
+ citation_color_level_5 ());
gdk_color_free (link);
gdk_color_free (visited);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]