]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-view.c
Add support for "Find Previous" as dictated by the GNOME HIG. A menu item
[evince.git] / shell / ev-view.c
index 8ac8aa7bbbcf093cfa06771c3ff808d67869f460..eb8f3292455d8e56dfa2552c918481c0d26bbaa2 100644 (file)
@@ -1605,8 +1605,13 @@ ev_view_expose_event (GtkWidget      *widget,
        int i;
 
        if (view->loading) {
+               GdkRectangle area = {0};
+               
+               area.width = widget->allocation.width;
+               area.height = widget->allocation.height;
+               
                draw_loading_text (view,
-                                  &(widget->allocation),
+                                  &area,
                                   &(event->area));
        }
 
@@ -3425,6 +3430,23 @@ ev_view_find_next (EvView *view)
        }
 }
 
+gboolean
+ev_view_can_find_previous (EvView *view)
+{
+       if (EV_IS_DOCUMENT_FIND (view->document)) {
+               EvDocumentFind *find = EV_DOCUMENT_FIND (view->document);
+               int i, n_pages;
+
+               n_pages = ev_page_cache_get_n_pages (view->page_cache);
+               for (i = n_pages - 1; i >= 0; i--) {
+                       if (ev_document_find_get_n_results (find, i) > 0) {
+                               return TRUE;
+                       }
+               }
+       }
+
+       return FALSE;
+}
 void
 ev_view_find_previous (EvView *view)
 {