[evince] shell: Add <Ctrl>H shortcut to add highlight annotations



commit d203432a5e6dd530574e3fe403576f9b0cc2d3a3
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Mar 9 16:59:44 2018 +0100

    shell: Add <Ctrl>H shortcut to add highlight annotations
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758329
    Fixes #635

 shell/ev-application.c |  1 +
 shell/ev-window.c      | 11 +++++++++++
 2 files changed, 12 insertions(+)
---
diff --git a/shell/ev-application.c b/shell/ev-application.c
index f64023e5..485045a3 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -1046,6 +1046,7 @@ ev_application_startup (GApplication *gapplication)
           "win.inverted-colors",        "<Ctrl>I", NULL,
           "win.reload",                 "<Ctrl>R", NULL,
           "win.add-annotation",         "s", NULL,
+          "win.highlight-annotation",   "<Ctrl>H", NULL,
           NULL
         };
 
diff --git a/shell/ev-window.c b/shell/ev-window.c
index a19a5c01..522aaed0 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -5606,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_highlight_annotation (GSimpleAction *action,
+                                        GVariant      *state,
+                                        gpointer       user_data)
+{
+       EvWindow *ev_window = user_data;
+
+       ev_window_begin_add_annot (ev_window, EV_ANNOTATION_TYPE_TEXT_MARKUP);
+}
+
 static void
 ev_window_cmd_add_annotation (GSimpleAction *action,
                              GVariant      *state,
@@ -5940,6 +5950,7 @@ static const GActionEntry actions[] = {
        { "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 },
+       { "highlight-annotation", NULL, NULL, "false", ev_window_cmd_add_highlight_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]