} else {
if (view->cursor == EV_VIEW_CURSOR_LINK ||
view->cursor == EV_VIEW_CURSOR_IBEAM ||
- view->cursor == EV_VIEW_CURSOR_DRAG)
+ view->cursor == EV_VIEW_CURSOR_DRAG ||
+ view->cursor == EV_VIEW_CURSOR_AUTOSCROLL)
ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
}
}
view->pressed_button = event->button;
view->selection_info.in_drag = FALSE;
+
+ if (view->scroll_info.autoscrolling)
+ return TRUE;
switch (event->button) {
case 1: {
-
- if (view->scroll_info.autoscrolling == TRUE) {
- view->scroll_info.autoscrolling = FALSE;
- return TRUE;
- }
-
EvImage *image;
EvFormField *field;
case 2:
/* use root coordinates as reference point because
* scrolling changes window relative coordinates */
- if (view->scroll_info.autoscrolling == TRUE) {
- view->scroll_info.autoscrolling = FALSE;
- return TRUE;
- }
view->drag_info.start.x = event->x_root;
view->drag_info.start.y = event->y_root;
view->drag_info.hadj = gtk_adjustment_get_value (view->hadjustment);
return TRUE;
case 3:
- if (!view->scroll_info.autoscrolling)
- view->scroll_info.start_y = event->y;
+ view->scroll_info.start_y = event->y;
return ev_view_do_popup_menu (view, event->x, event->y);
}
if (view->scroll_info.autoscrolling) {
view->scroll_info.last_y = y;
+ return TRUE;
}
if (view->selection_info.in_drag) {
view->drag_info.in_drag = FALSE;
view->image_dnd_info.in_drag = FALSE;
+
+ if (view->scroll_info.autoscrolling) {
+ view->scroll_info.autoscrolling = FALSE;
+ if (view->scroll_info.timeout_id) {
+ g_source_remove (view->scroll_info.timeout_id);
+ view->scroll_info.timeout_id = 0;
+ }
+ ev_view_handle_cursor_over_xy (view, event->x, event->y);
+ view->pressed_button = -1;
+
+ return TRUE;
+ }
view->drag_info.release_timeout_id = g_timeout_add (20,
(GSourceFunc)ev_view_scroll_drag_release, view);
gtk_widget_queue_draw (GTK_WIDGET (view));
}
-static gboolean ev_view_autoscroll_cb (EvView *view)
+static gboolean
+ev_view_autoscroll_cb (EvView *view)
{
gdouble speed, value;
}
-void ev_view_autoscroll(EvView *view)
+void
+ev_view_autoscroll (EvView *view)
{
view->scroll_info.autoscrolling = TRUE;
view->scroll_info.timeout_id = g_timeout_add (20, (GSourceFunc)(ev_view_autoscroll_cb), view);