]> www.fi.muni.cz Git - evince.git/commitdiff
Based on a patch from carlosgc@gnome.org. Mouse buttons switch pages in
authorMarco Pesenti Gritti <mpg@redhat.com>
Thu, 22 Sep 2005 13:02:46 +0000 (13:02 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Thu, 22 Sep 2005 13:02:46 +0000 (13:02 +0000)
2005-09-22  Marco Pesenti Gritti  <mpg@redhat.com>

        * shell/ev-view.c: (ev_view_button_release_event):

        Based on a patch from carlosgc@gnome.org. Mouse buttons
        switch pages in presentation mode.

ChangeLog
shell/ev-view.c

index c894b778a0c3472ca15111a54c5fecd98585a89b..be7aca19c89ee9d4ea378cb83f7b319747066f69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-09-22  Marco Pesenti Gritti  <mpg@redhat.com>
+
+       * shell/ev-view.c: (ev_view_button_release_event):
+
+       Based on a patch from carlosgc@gnome.org. Mouse buttons
+       switch pages in presentation mode.
+
 2005-09-19  Marco Pesenti Gritti  <mpg@redhat.com>
 
        * shell/ev-page-cache.c: (ev_page_cache_get_size):
index fa2df5b08900ae3059f429764994d5e9f212a00f..5cc21ab1eedddd2631052b8784d6fa18cf46ae0a 100644 (file)
@@ -1673,25 +1673,37 @@ ev_view_button_release_event (GtkWidget      *widget,
                              GdkEventButton *event)
 {
        EvView *view = EV_VIEW (widget);
+       EvLink *link;
 
        if (view->pressed_button == 2) {
                ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
        }
 
+       if (view->document) {
+               link = get_link_at_location (view, event->x + view->scroll_x,
+                                            event->y + view->scroll_y);
+       } else {
+               link = NULL;
+       }
+
        view->pressed_button = -1;
        view->drag_info.in_drag = FALSE;
 
        if (view->selection_info.selections) {
                ev_view_update_primary_selection (view);
-       } else if (view->document) {
-               EvLink *link;
-
-               link = get_link_at_location (view, event->x + view->scroll_x, event->y + view->scroll_y);
-               if (link) {
-                       ev_view_goto_link (view, link);
+       } else if (link) {
+               ev_view_goto_link (view, link);
+       } else if (view->presentation) {
+               switch (event->button) {
+               case 1:
+                       ev_view_next_page (view);       
+                       return TRUE;
+               case 3:
+                       ev_view_previous_page (view);   
+                       return TRUE;
                }
        }
-
        return FALSE;
 }