[evince] shell: Add "s" key shortcut to add text annotation



commit 138d2cb8f1de5c98a44fd2dfb41d183393c255b2
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Mar 9 16:47:02 2018 +0100

    shell: Add "s" key shortcut to add text annotation
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758329
    Partial fix for #635.

 shell/ev-application.c |  1 +
 shell/ev-window.c      | 13 +++++++++++++
 2 files changed, 14 insertions(+)
---
diff --git a/shell/ev-application.c b/shell/ev-application.c
index e88109c6..f64023e5 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -1045,6 +1045,7 @@ ev_application_startup (GApplication *gapplication)
           "win.rotate-right",           "<Ctrl>Right", NULL,
           "win.inverted-colors",        "<Ctrl>I", NULL,
           "win.reload",                 "<Ctrl>R", NULL,
+          "win.add-annotation",         "s", NULL,
           NULL
         };
 
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 1705e13d..a19a5c01 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -388,6 +388,8 @@ static void     recent_view_item_activated_cb           (EvRecentView     *recen
                                                          const char       *uri,
                                                          EvWindow         *ev_window);
 static void     ev_window_fullscreen_show_toolbar       (EvWindow         *ev_window);
+static void     ev_window_begin_add_annot               (EvWindow         *ev_window,
+                                                        EvAnnotationType  annot_type);
 
 static gchar *nautilus_sendto = NULL;
 
@@ -5604,6 +5606,16 @@ ev_window_cmd_view_toggle_caret_navigation (GSimpleAction *action,
        ev_window_set_message_area (window, message_area);
 }
 
+static void
+ev_window_cmd_add_annotation (GSimpleAction *action,
+                             GVariant      *state,
+                             gpointer       user_data)
+{
+       EvWindow *ev_window = user_data;
+
+       ev_window_begin_add_annot (ev_window, EV_ANNOTATION_TYPE_TEXT);
+}
+
 static void
 ev_window_cmd_toggle_edit_annots (GSimpleAction *action,
                                  GVariant      *state,
@@ -5927,6 +5939,7 @@ static const GActionEntry actions[] = {
        { "escape", ev_window_cmd_escape },
        { "open-menu", ev_window_cmd_action_menu },
        { "caret-navigation", NULL, NULL, "false", ev_window_cmd_view_toggle_caret_navigation },
+       { "add-annotation", NULL, NULL, "false", ev_window_cmd_add_annotation },
        { "toggle-edit-annots", NULL, NULL, "false", ev_window_cmd_toggle_edit_annots },
        /* Popups specific items */
        { "annotate-selected-text", ev_window_popup_cmd_annotate_selected_text },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]