From 512ce5e411c8b0e614097cd84ecf209dc8ad0d7e Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 22 Sep 2005 13:02:46 +0000 Subject: [PATCH] Based on a patch from carlosgc@gnome.org. Mouse buttons switch pages in 2005-09-22 Marco Pesenti Gritti * 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 | 7 +++++++ shell/ev-view.c | 26 +++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c894b778..be7aca19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-09-22 Marco Pesenti Gritti + + * 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 * shell/ev-page-cache.c: (ev_page_cache_get_size): diff --git a/shell/ev-view.c b/shell/ev-view.c index fa2df5b0..5cc21ab1 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -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; } -- 2.43.5