[evince] use IBEAM cursor for TEXT_MARKUP annotations



commit 38aba718496dc8a7a7b5b6bcf7fc94983a69ec73
Author: Philipp Raich <philipp raich gmail com>
Date:   Sun Nov 13 18:56:36 2016 +0100

    use IBEAM cursor for TEXT_MARKUP annotations
    
    Text markup annotations are hard with the cursor
    used so far for annotations in general (ADD), using
    I-Beam is better for text selection.
    
    This patch further removes checking the currently
    set cursor type in `ev_view_handle_cursor_over_xy`
    while setting it, at least for creating annotations,
    as this is taken care of by `ev_view_set_cursor`
    already.
    
    Setting the cursor to NORMAL in `ev_view_create_annotation`
    is removed, as it seems superfluous and introduces wrong
    behavior during dragging (i.e. while creating a text
    markup annotation), and the cursor type is handled
    by `ev_view_handle_cursor_over_xy` already.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774018

 libview/ev-view.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 7c416f6..5f62ff2 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -2111,9 +2111,12 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y)
        if (view->cursor == EV_VIEW_CURSOR_HIDDEN)
                return;
 
-       if (view->adding_annot_info.adding_annot && !view->adding_annot_info.annot) {
-               if (view->cursor != EV_VIEW_CURSOR_ADD)
+       if (view->adding_annot_info.adding_annot) {
+               if (view->adding_annot_info.type == EV_ANNOTATION_TYPE_TEXT_MARKUP) {
+                       ev_view_set_cursor (view, EV_VIEW_CURSOR_IBEAM);
+               } else if (!view->adding_annot_info.annot) {
                        ev_view_set_cursor (view, EV_VIEW_CURSOR_ADD);
+               }
                return;
        }
 
@@ -3408,7 +3411,6 @@ ev_view_create_annotation (EvView *view)
        cairo_region_destroy (region);
 
        view->adding_annot_info.annot = annot;
-       ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
 }
 
 void


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