From d165b0fba12517f8c201352560192ace252f9fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= Date: Tue, 1 May 2018 18:26:36 +0500 Subject: [PATCH] annotations-toolbar: add text markup annotation from selection When there's a text selection, and user clicks the toolbutton for "Add text markup annotation" then we will directly add a text markup annotation from the selected text, as that is an intuitive way to do it. Part of issue #663 --- shell/ev-window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/ev-window.c b/shell/ev-window.c index 83d607ba0..5a218e2a9 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -6054,6 +6054,12 @@ static void ev_window_begin_add_annot (EvWindow *window, EvAnnotationType annot_type) { + if (annot_type == EV_ANNOTATION_TYPE_TEXT_MARKUP && + ev_view_get_has_selection (EV_VIEW (window->priv->view))) { + ev_view_add_text_markup_annotation_for_selected_text (EV_VIEW (window->priv->view)); + return; + } + ev_view_begin_add_annotation (EV_VIEW (window->priv->view), annot_type); } -- GitLab