aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-08-14 21:06:43 +0800
committerTomas Popela <tpopela@redhat.com>2014-08-14 21:06:43 +0800
commita1ea8e92718f342daa0e0dec3d3a0622d1127e3f (patch)
tree50017fca2e1753438f6478327f26151eebc846ee
parent915bb0b5425da855e019fb57a41c837d5ac4313e (diff)
downloadgsoc2013-evolution-a1ea8e92718f342daa0e0dec3d3a0622d1127e3f.tar
gsoc2013-evolution-a1ea8e92718f342daa0e0dec3d3a0622d1127e3f.tar.gz
gsoc2013-evolution-a1ea8e92718f342daa0e0dec3d3a0622d1127e3f.tar.bz2
gsoc2013-evolution-a1ea8e92718f342daa0e0dec3d3a0622d1127e3f.tar.lz
gsoc2013-evolution-a1ea8e92718f342daa0e0dec3d3a0622d1127e3f.tar.xz
gsoc2013-evolution-a1ea8e92718f342daa0e0dec3d3a0622d1127e3f.tar.zst
gsoc2013-evolution-a1ea8e92718f342daa0e0dec3d3a0622d1127e3f.zip
EHTMLEditorView - Unset the bold font when the return is pressed in the Heading 1 - 6 block
When the return is pressed in a H1-6 element, WebKit doesn't continue with the same element, but creates normal paragraph, so we have to unset the bold font, otherwise the UI will report that we are still writing in bold.
-rw-r--r--e-util/e-html-editor-view.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index e5887ef3a6..8db6b6b909 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -2476,6 +2476,7 @@ html_editor_view_key_press_event (GtkWidget *widget,
if (is_return_key (event)) {
EHTMLEditorSelection *selection;
+ EHTMLEditorSelectionBlockFormat format;
selection = e_html_editor_view_get_selection (view);
/* When user presses ENTER in a citation block, WebKit does
@@ -2485,6 +2486,14 @@ html_editor_view_key_press_event (GtkWidget *widget,
remove_input_event_listener_from_body (view);
return (insert_new_line_into_citation (view, "")) ? TRUE : FALSE;
}
+
+ /* When the return is pressed in a H1-6 element, WebKit doesn't
+ * continue with the same element, but creates normal paragraph,
+ * so we have to unset the bold font. */
+ format = e_html_editor_selection_get_block_format (selection);
+ if (format >= E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H1 &&
+ format <= E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H6)
+ e_html_editor_selection_set_bold (selection, FALSE);
}
if (event->keyval == GDK_KEY_BackSpace) {