]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-view.c
Updated Belarusian Translation
[evince.git] / shell / ev-view.c
index 28a21393b7ba3c4738815a8a097aa8bed5453a03..129d87c334928e2599ec1c020d5457f3704cad82 100644 (file)
@@ -1907,7 +1907,8 @@ ev_view_form_field_choice_changed (GtkWidget   *widget,
                gint item;
                
                item = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
-               if (GPOINTER_TO_INT (field_choice->selected_items->data) != item) {
+               if (!field_choice->selected_items ||
+                   GPOINTER_TO_INT (field_choice->selected_items->data) != item) {
                        g_list_free (field_choice->selected_items);
                        field_choice->selected_items = NULL;
                        field_choice->selected_items = g_list_prepend (field_choice->selected_items,
@@ -2482,7 +2483,7 @@ ev_view_expose_event (GtkWidget      *widget,
        cairo_t *cr;
        gint     i;
 
-       if (view->animation) {
+       if (view->animation && ev_transition_animation_ready (view->animation)) {
                GdkRectangle page_area;
                GtkBorder    border;
 
@@ -3132,31 +3133,30 @@ ev_view_button_release_event (GtkWidget      *widget,
        EvView *view = EV_VIEW (widget);
        EvLink *link = NULL;
 
-       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);
+               ev_view_autoscroll_stop (view);
                view->pressed_button = -1;
 
                return TRUE;
        } 
-       
-       view->drag_info.release_timeout_id = g_timeout_add (20,
-                       (GSourceFunc)ev_view_scroll_drag_release, view);
 
-       if (view->pressed_button == 2) {
-               ev_view_handle_cursor_over_xy (view, event->x, event->y);
+       if (view->drag_info.in_drag) {
+               view->drag_info.release_timeout_id =
+                       g_timeout_add (20,
+                                      (GSourceFunc)ev_view_scroll_drag_release, view);
        }
 
-       if (view->document && view->pressed_button != 3) {
+       if (view->document && !view->drag_info.in_drag && view->pressed_button != 3) {
                link = ev_view_get_link_at_location (view, event->x, event->y);
        }
+       
+       view->drag_info.in_drag = FALSE;
+
+       if (view->pressed_button == 2) {
+               ev_view_handle_cursor_over_xy (view, event->x, event->y);
+       }
 
        view->pressed_button = -1;
 
@@ -3739,9 +3739,12 @@ draw_one_page (EvView       *view,
                page_surface = ev_pixbuf_cache_get_surface (view->pixbuf_cache, page);
 
                if (!page_surface) {
-                       draw_loading_text (view,
-                                          &real_page_area,
-                                          expose_area);
+                       if (!view->presentation) {
+                               draw_loading_text (view,
+                                                  &real_page_area,
+                                                  expose_area);
+                       }
+
                        *page_ready = FALSE;
 
                        return;
@@ -4463,10 +4466,42 @@ ev_view_autoscroll_cb (EvView *view)
 }
 
 void
-ev_view_autoscroll (EvView *view)
+ev_view_autoscroll_start (EvView *view)
 {
+       gint x, y;
+       
+       g_return_if_fail (EV_IS_VIEW (view));
+
+       if (view->scroll_info.autoscrolling)
+               return;
+       
        view->scroll_info.autoscrolling = TRUE;
-       view->scroll_info.timeout_id = g_timeout_add (20, (GSourceFunc)(ev_view_autoscroll_cb), view);
+       view->scroll_info.timeout_id =
+               g_timeout_add (20, (GSourceFunc)ev_view_autoscroll_cb,
+                              view);
+       
+       gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+       ev_view_handle_cursor_over_xy (view, x, y);
+}
+
+void
+ev_view_autoscroll_stop (EvView *view)
+{
+       gint x, y;
+       
+       g_return_if_fail (EV_IS_VIEW (view));
+
+       if (!view->scroll_info.autoscrolling)
+               return;
+
+       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;
+       }
+
+       gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+       ev_view_handle_cursor_over_xy (view, x, y);
 }
 
 void
@@ -4728,17 +4763,10 @@ ev_view_presentation_transition_start (EvView *view)
        duration = ev_document_transition_get_page_duration (EV_DOCUMENT_TRANSITION (view->document),
                                                             view->current_page);
        if (duration > 0) {
-#if GLIB_CHECK_VERSION (2, 13, 0)
                view->trans_timeout_id =
                        g_timeout_add_seconds (duration,
                                               (GSourceFunc) transition_next_page,
                                               view);
-#else
-               view->trans_timeout_id =
-                       g_timeout_add (duration * 1000,
-                                      (GSourceFunc) transition_next_page,
-                                      view);
-#endif
        }
 }