Index: shell/ev-sidebar-thumbnails.c
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-sidebar-thumbnails.c,v
retrieving revision 1.24
diff -u -p -r1.24 ev-sidebar-thumbnails.c
--- shell/ev-sidebar-thumbnails.c	12 Apr 2005 06:51:05 -0000	1.24
+++ shell/ev-sidebar-thumbnails.c	15 Apr 2005 23:12:09 -0000
@@ -255,7 +255,7 @@ ev_sidebar_thumbnails_set_document (EvSi
 	 * icon.  */
 	g_mutex_lock (EV_DOC_MUTEX);
 	ev_document_thumbnails_get_dimensions (EV_DOCUMENT_THUMBNAILS (priv->document),
-					       1, THUMBNAIL_WIDTH, &width, &height);
+					       0, THUMBNAIL_WIDTH, &width, &height);
 	g_mutex_unlock (EV_DOC_MUTEX);
 
 	loading_icon = ev_document_misc_get_thumbnail_frame (width, height, NULL);
Index: shell/ev-sidebar.c
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-sidebar.c,v
retrieving revision 1.11
diff -u -p -r1.11 ev-sidebar.c
--- shell/ev-sidebar.c	23 Mar 2005 11:07:32 -0000	1.11
+++ shell/ev-sidebar.c	15 Apr 2005 23:12:09 -0000
@@ -394,19 +394,48 @@ ev_sidebar_set_document (EvSidebar   *si
 	     result;
 	     result = gtk_tree_model_iter_next (priv->page_model, &iter)) {
 		GtkWidget *widget;
+		GtkWidget *menu_widget;
 
 		gtk_tree_model_get (priv->page_model, &iter,
 				    PAGE_COLUMN_MAIN_WIDGET, &widget,
+				    PAGE_COLUMN_MENU_ITEM, &menu_widget,
 				    -1);
 			 
-		if (EV_IS_SIDEBAR_LINKS (widget)
-		    && EV_IS_DOCUMENT_LINKS (document)
-		    && ev_document_links_has_document_links (EV_DOCUMENT_LINKS (document))) {
-			ev_sidebar_links_set_document (EV_SIDEBAR_LINKS (widget), document);
-		} else if (EV_IS_SIDEBAR_THUMBNAILS (widget) &&
-			   EV_IS_DOCUMENT_THUMBNAILS (document)) {
-			ev_sidebar_thumbnails_set_document
-				(EV_SIDEBAR_THUMBNAILS (widget), document);
+
+		if (EV_IS_SIDEBAR_LINKS (widget)) {
+			if (EV_IS_DOCUMENT_LINKS (document) &&
+			        ev_document_links_has_document_links (EV_DOCUMENT_LINKS (document))) {
+				ev_sidebar_links_set_document (EV_SIDEBAR_LINKS (widget), document);
+				continue;
+			} else {
+				gtk_widget_set_sensitive (menu_widget, FALSE);
+			}
+		}
+		
+		if (EV_IS_SIDEBAR_THUMBNAILS (widget)) {
+			if (EV_IS_DOCUMENT_THUMBNAILS (document) &&
+			    (ev_document_get_n_pages (document) > 1)) {
+				ev_sidebar_thumbnails_set_document (EV_SIDEBAR_THUMBNAILS (widget), document);
+				continue;
+			} else {
+				gtk_widget_set_sensitive (menu_widget, FALSE);
+			}
 		}
 	}
 }
+
+gboolean   
+ev_sidebar_supports_document (EvSidebar   *ev_sidebar,
+			      EvDocument  *document)
+{
+    gboolean need_thumbnails;
+    gboolean need_index;
+    
+    need_thumbnails = EV_IS_DOCUMENT_THUMBNAILS (document) && (ev_document_get_n_pages (document) > 1);
+    need_index = (EV_IS_DOCUMENT_LINKS (document));
+    
+    return need_thumbnails || need_index;
+}
+
+
+
Index: shell/ev-sidebar.h
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-sidebar.h,v
retrieving revision 1.5
diff -u -p -r1.5 ev-sidebar.h
--- shell/ev-sidebar.h	8 Apr 2005 05:28:38 -0000	1.5
+++ shell/ev-sidebar.h	15 Apr 2005 23:12:09 -0000
@@ -50,14 +50,16 @@ struct _EvSidebarClass {
 	GtkVBoxClass base_class;
 };
 
-GType      ev_sidebar_get_type     (void);
-GtkWidget *ev_sidebar_new          (void);
-void       ev_sidebar_add_page     (EvSidebar   *ev_sidebar,
-				    const gchar *page_id,
-				    const gchar *title,
-				    GtkWidget   *main_widget);
-void       ev_sidebar_set_document (EvSidebar   *ev_sidebar,
-				    EvDocument  *document);
+GType      ev_sidebar_get_type  	   (void);
+GtkWidget *ev_sidebar_new         	   (void);
+void       ev_sidebar_add_page    	   (EvSidebar   *ev_sidebar,
+					    const gchar *page_id,
+					    const gchar *title,
+					    GtkWidget   *main_widget);
+void       ev_sidebar_set_document	   (EvSidebar   *ev_sidebar,
+					    EvDocument  *document);
+gboolean   ev_sidebar_supports_document	   (EvSidebar   *ev_sidebar,
+					    EvDocument  *document);
 
 G_END_DECLS
 
Index: shell/ev-window.c
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-window.c,v
retrieving revision 1.98
diff -u -p -r1.98 ev-window.c
--- shell/ev-window.c	15 Apr 2005 09:10:59 -0000	1.98
+++ shell/ev-window.c	15 Apr 2005 23:12:09 -0000
@@ -503,14 +503,6 @@ update_window_title (EvDocument *documen
 	g_free (title);
 }
 
-/* This function assumes that ev_window just had ev_window->document set.
- */
-static gboolean
-document_supports_sidebar (EvDocument *document)
-{
-	return (EV_IS_DOCUMENT_THUMBNAILS (document) || (EV_IS_DOCUMENT_LINKS (document)));
-}
-
 static void
 hide_sidebar_and_actions (EvWindow *ev_window)
 {
@@ -565,7 +557,7 @@ ev_window_setup_document (EvWindow *ev_w
 
 	ev_window_set_page_mode (ev_window, PAGE_MODE_SINGLE_PAGE);
 
-	if (document_supports_sidebar (document)) 
+	if (ev_sidebar_supports_document (sidebar, document)) 
 		ev_sidebar_set_document (sidebar, document);
 	else
 		hide_sidebar_and_actions (ev_window);
