[evolution] Bug 745899 - Shift+Tab in message body doesn't move focus to headers
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 745899 - Shift+Tab in message body doesn't move focus to headers
- Date: Wed, 11 Mar 2015 13:45:24 +0000 (UTC)
commit 61a102e9a4adaa42de3501ce3dde98c625225aa6
Author: Tomas Popela <tpopela redhat com>
Date: Wed Mar 11 14:36:00 2015 +0100
Bug 745899 - Shift+Tab in message body doesn't move focus to headers
The behavior right now is. When tabulator is pressed in view (outside
of table) tabulator is inserted. When tab is pressed inside a table,
caret is moved to next cell in the table. If we are in the last cell of
table, caret is moved to the block after table. When Shift+Tab is pressed
inside the view (outside of table) caret jumps to headers. When
Shift+Tab is pressed in table the caret is moved to previous cell. If
the caret is in first cell of table it is moved to the block that is
before the table. If there is no block before the table, focus is moved
to headers.
composer/e-msg-composer.c | 11 +++++++++++
e-util/e-html-editor-view.c | 17 ++++++-----------
2 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 81ead4d..7bab538 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2541,6 +2541,17 @@ msg_composer_key_press_event (GtkWidget *widget,
}
if (gtk_widget_is_focus (GTK_WIDGET (view))) {
+ if (event->keyval == GDK_KEY_ISO_Left_Tab) {
+ gboolean view_processed = FALSE;
+
+ g_signal_emit_by_name (view, "key-press-event", event, &view_processed);
+
+ if (!view_processed)
+ gtk_widget_grab_focus (input_widget);
+
+ return TRUE;
+ }
+
if ((((event)->state & GDK_SHIFT_MASK) &&
((event)->keyval == GDK_KEY_Insert)) ||
(((event)->state & GDK_CONTROL_MASK) &&
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 133ebff..4ad198e 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -3185,12 +3185,11 @@ jump_to_next_table_cell (EHTMLEditorView *view,
WebKitDOMRange *range;
document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
- window = webkit_dom_document_get_default_view (document);
- selection = webkit_dom_dom_window_get_selection (window);
-
- if (webkit_dom_dom_selection_get_range_count (selection) < 1)
+ if (!selection_is_in_table (document, NULL, NULL))
return FALSE;
+ window = webkit_dom_document_get_default_view (document);
+ selection = webkit_dom_dom_window_get_selection (window);
range = webkit_dom_dom_selection_get_range_at (selection, 0, NULL);
node = webkit_dom_range_get_start_container (range, NULL);
@@ -3331,18 +3330,14 @@ html_editor_view_key_press_event (GtkWidget *widget,
}
if (event->keyval == GDK_KEY_Tab || event->keyval == GDK_KEY_ISO_Left_Tab) {
- WebKitDOMDocument *document;
-
- document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
- if (selection_is_in_table (document, NULL, NULL))
- if (jump_to_next_table_cell (view, event->keyval == GDK_KEY_ISO_Left_Tab))
- return TRUE;
+ if (jump_to_next_table_cell (view, event->keyval == GDK_KEY_ISO_Left_Tab))
+ return TRUE;
if (event->keyval == GDK_KEY_Tab)
return e_html_editor_view_exec_command (
view, E_HTML_EDITOR_VIEW_COMMAND_INSERT_TEXT, "\t");
else
- return TRUE;
+ return FALSE;
}
if (is_return_key (event)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]