[evolution/449-support-markdown-in-composer] EMarkdownEditor: Add 'Insert Emoji' item on the tool bar
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/449-support-markdown-in-composer] EMarkdownEditor: Add 'Insert Emoji' item on the tool bar
- Date: Tue, 8 Feb 2022 11:34:12 +0000 (UTC)
commit c7a6a01d1996e156025735b55f8c332a26fd6dab
Author: Milan Crha <mcrha redhat com>
Date: Tue Feb 8 12:33:24 2022 +0100
EMarkdownEditor: Add 'Insert Emoji' item on the tool bar
data/icons/CMakeLists.txt | 2 ++
...icolor_actions_scalable_markdown-emoji-dark.svg | 25 ++++++++++++++++++++++
.../hicolor_actions_scalable_markdown-emoji.svg | 25 ++++++++++++++++++++++
src/e-util/e-markdown-editor.c | 12 +++++++++++
4 files changed, 64 insertions(+)
---
diff --git a/data/icons/CMakeLists.txt b/data/icons/CMakeLists.txt
index d6cbfb2b3f..64d2395b32 100644
--- a/data/icons/CMakeLists.txt
+++ b/data/icons/CMakeLists.txt
@@ -98,6 +98,8 @@ set(private_icons
hicolor_actions_scalable_markdown-bullets-dark.svg
hicolor_actions_scalable_markdown-code.svg
hicolor_actions_scalable_markdown-code-dark.svg
+ hicolor_actions_scalable_markdown-emoji.svg
+ hicolor_actions_scalable_markdown-emoji-dark.svg
hicolor_actions_scalable_markdown-header.svg
hicolor_actions_scalable_markdown-header-dark.svg
hicolor_actions_scalable_markdown-help.svg
diff --git a/data/icons/hicolor_actions_scalable_markdown-emoji-dark.svg
b/data/icons/hicolor_actions_scalable_markdown-emoji-dark.svg
new file mode 100644
index 0000000000..a80c068f3b
--- /dev/null
+++ b/data/icons/hicolor_actions_scalable_markdown-emoji-dark.svg
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ version="1.1"
+ id="svg33406"
+ xml:space="preserve"
+ width="20"
+ height="20"
+ viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"><defs
+ id="defs33410" /><path
+
style="fill:none;fill-rule:evenodd;stroke:#e6e6e6;stroke-width:1.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 1.9005051,10.0005 c -6.75e-4,-4.050675 4.049325,-8.100675 8.1000409,-8.0999595 4.050715,7.155e-4
8.100634,4.0506345 8.099919,8.1000005 -7.16e-4,4.049365 -4.050635,8.099284 -8.1,8.099919 -4.0493659,6.34e-4
-8.0992849,-4.049285 -8.0999599,-8.09996 z"
+ id="path11753" /><path
+
style="fill:#e6e6e6;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 7.0712862,5.7713633 c 1.0005,5e-4 2.0004999,1.0005001 1.9999899,2.00001 -5.1e-4,0.9995099
-1.00049,1.9994899 -1.9999999,1.9999799 -0.9995099,4.9e-4 -1.9994899,-0.99949 -1.99998,-1.9999999
-4.9e-4,-1.00051 0.99949,-2.00049 1.99999,-1.99999 z"
+ id="path12190" /><path
+
style="fill:#e6e6e6;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 12.96911,5.728406 c 1.0005,5e-4 2.0005,1.0005 1.99999,2.00001 -5.1e-4,0.99951 -1.00049,1.99949
-2,1.99998 -0.99951,4.899e-4 -1.99949,-0.9994902 -1.99998,-2 -4.9e-4,-1.0005098 0.99949,-2.0004899
1.99999,-1.99999 z"
+ id="path12190-3" /><path
+
style="fill:#e6e6e6;fill-rule:evenodd;stroke:#e6e6e6;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 5.1486969,12.08349 5.0469071,2.521786 4.953093,-2.521786 -5,1 z"
+ id="path12608" /></svg>
diff --git a/data/icons/hicolor_actions_scalable_markdown-emoji.svg
b/data/icons/hicolor_actions_scalable_markdown-emoji.svg
new file mode 100644
index 0000000000..10eec0364b
--- /dev/null
+++ b/data/icons/hicolor_actions_scalable_markdown-emoji.svg
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ version="1.1"
+ id="svg33406"
+ xml:space="preserve"
+ width="20"
+ height="20"
+ viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"><defs
+ id="defs33410" /><path
+
style="fill:none;fill-rule:evenodd;stroke:#1a1a1a;stroke-width:1.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 1.9005051,10.0005 c -6.75e-4,-4.050675 4.049325,-8.100675 8.1000409,-8.0999595 4.050715,7.155e-4
8.100634,4.0506345 8.099919,8.1000005 -7.16e-4,4.049365 -4.050635,8.099284 -8.1,8.099919 -4.0493659,6.34e-4
-8.0992849,-4.049285 -8.0999599,-8.09996 z"
+ id="path11753" /><path
+
style="fill:#1a1a1a;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 7.0712862,5.7713633 c 1.0005,5e-4 2.0004999,1.0005001 1.9999899,2.00001 -5.1e-4,0.9995099
-1.00049,1.9994899 -1.9999999,1.9999799 -0.9995099,4.9e-4 -1.9994899,-0.99949 -1.99998,-1.9999999
-4.9e-4,-1.00051 0.99949,-2.00049 1.99999,-1.99999 z"
+ id="path12190" /><path
+
style="fill:#1a1a1a;fill-rule:evenodd;stroke:none;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 12.96911,5.728406 c 1.0005,5e-4 2.0005,1.0005 1.99999,2.00001 -5.1e-4,0.99951 -1.00049,1.99949
-2,1.99998 -0.99951,4.899e-4 -1.99949,-0.9994902 -1.99998,-2 -4.9e-4,-1.0005098 0.99949,-2.0004899
1.99999,-1.99999 z"
+ id="path12190-3" /><path
+
style="fill:#1a1a1a;fill-rule:evenodd;stroke:#1a1a1a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 5.1486969,12.08349 5.0469071,2.521786 4.953093,-2.521786 -5,1 z"
+ id="path12608" /></svg>
diff --git a/src/e-util/e-markdown-editor.c b/src/e-util/e-markdown-editor.c
index b4cc2d0d66..929d1747f5 100644
--- a/src/e-util/e-markdown-editor.c
+++ b/src/e-util/e-markdown-editor.c
@@ -741,6 +741,17 @@ e_markdown_editor_add_header_cb (GtkToolButton *button,
e_markdown_editor_surround_selection (self, TRUE, "# ", NULL);
}
+static void
+e_markdown_editor_insert_emoji_cb (GtkToolButton *button,
+ gpointer user_data)
+{
+ EMarkdownEditor *self = user_data;
+
+ g_return_if_fail (E_IS_MARKDOWN_EDITOR (self));
+
+ g_signal_emit_by_name (self->priv->text_view, "insert-emoji", 0, NULL);
+}
+
static void
e_markdown_editor_markdown_syntax_cb (GtkToolButton *button,
gpointer user_data)
@@ -838,6 +849,7 @@ static struct _toolbar_items toolbar_items[] = {
ITEM (N_("Add a bullet list"), "markdown-bullets", e_markdown_editor_add_bullet_list_cb),
ITEM (N_("Add a numbered list"), "markdown-numbers", e_markdown_editor_add_numbered_list_cb),
ITEM (N_("Add a header"), "markdown-header", e_markdown_editor_add_header_cb),
+ ITEM (N_("Insert Emoji"), "markdown-emoji", e_markdown_editor_insert_emoji_cb),
ITEM (NULL, "", NULL),
ITEM (N_("Open online common mark documentation"), "markdown-help", G_CALLBACK
(e_markdown_editor_markdown_syntax_cb))
#undef ITEM
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]