]> www.fi.muni.cz Git - evince.git/commitdiff
Scroll pages in page entry with mouse wheel. Fixes bug #324122. Thanks to
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Thu, 20 Dec 2007 22:31:05 +0000 (22:31 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Thu, 20 Dec 2007 22:31:05 +0000 (22:31 +0000)
2007-12-21  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>

* shell/ev-page-action.c: (page_scroll_cb), (create_tool_item):

Scroll pages in page entry with mouse wheel. Fixes bug
#324122. Thanks to David Turner <cillian64@googlemail.com>.

svn path=/trunk/; revision=2776

ChangeLog
shell/ev-page-action.c

index c4a3ccebd3603ab927c239d82205bd595aeede65..3ead0d6954958b8ca7bbd792e389a69d26959ad7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-12-21  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-page-action.c: (page_scroll_cb), (create_tool_item):
+       
+       Scroll pages in page entry with mouse wheel. Fixes bug
+       #324122. Thanks to David Turner <cillian64@googlemail.com>.
+
 2007-12-20  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * backend/dvi/Makefile.am:
index 0571b6d162d467fbce8b00b315d5e6c6281dcda4..aab86ec7dbede280cd73e765e2fdb7c2e3ab1b34 100644 (file)
@@ -143,6 +143,21 @@ activate_cb (GtkWidget *entry, GtkAction *action)
        g_free (page_label);
 }
 
+static gboolean page_scroll_cb(GtkWidget *widget, GdkEventScroll *event, EvPageAction* action)
+{
+       gint pageno;
+
+       pageno = ev_page_cache_get_current_page (action->priv->page_cache);
+       if ((event->direction == GDK_SCROLL_DOWN) && 
+           (pageno < ev_page_cache_get_n_pages(action->priv->page_cache) - 1))
+               pageno++;
+       if ((event->direction == GDK_SCROLL_UP) && (pageno > 0))
+               pageno--;
+       ev_page_cache_set_current_page (action->priv->page_cache, pageno);
+       
+       return TRUE;
+}
+
 static GtkWidget *
 create_tool_item (GtkAction *action)
 {
@@ -157,6 +172,8 @@ create_tool_item (GtkAction *action)
        gtk_box_set_spacing (GTK_BOX (hbox), 6);
 
        proxy->entry = gtk_entry_new ();
+       g_signal_connect(proxy->entry, "scroll-event",G_CALLBACK(page_scroll_cb),action);
+       gtk_widget_add_events(GTK_WIDGET(proxy->entry),GDK_BUTTON_MOTION_MASK);
        gtk_entry_set_width_chars (GTK_ENTRY (proxy->entry), 5);
        gtk_box_pack_start (GTK_BOX (hbox), proxy->entry, FALSE, FALSE, 0);
        gtk_widget_show (proxy->entry);