From 0cded54c0376c9b38e1070b53759245d720f3cec Mon Sep 17 00:00:00 2001 From: Nickolay V. Shmyrev Date: Tue, 27 Dec 2005 07:56:18 +0000 Subject: Horizontal scroll on selection also. * shell/ev-view.c: (selection_scroll_timeout_cb): Horizontal scroll on selection also. --- (limited to 'shell') diff --git a/shell/ev-view.c b/shell/ev-view.c index 1f089fc..285d52b 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -1706,10 +1706,10 @@ selection_update_idle_cb (EvView *view) static gboolean selection_scroll_timeout_cb (EvView *view) { - gint y, shift = 0; + gint x, y, shift = 0; GtkWidget *widget = GTK_WIDGET (view); - gtk_widget_get_pointer (widget, NULL, &y); + gtk_widget_get_pointer (widget, &x, &y); if (y > widget->allocation.height) { shift = (y - widget->allocation.height) / 2; @@ -1723,6 +1723,20 @@ selection_scroll_timeout_cb (EvView *view) view->vadjustment->lower, view->vadjustment->upper - view->vadjustment->page_size)); + + if (x > widget->allocation.width) { + shift = (x - widget->allocation.width) / 2; + } else if (x < 0) { + shift = x / 2; + } + + if (shift) + gtk_adjustment_set_value (view->hadjustment, + CLAMP (view->hadjustment->value + shift, + view->hadjustment->lower, + view->hadjustment->upper - + view->hadjustment->page_size)); + return TRUE; } -- cgit v0.9.1