diff --git a/data/playlist.glade b/data/playlist.glade
index 57bce23..6ec6a37 100644
--- a/data/playlist.glade
+++ b/data/playlist.glade
@@ -56,7 +56,7 @@
 
       <child>
 	<widget class="GtkVBox" id="vbox4">
-	  <property name="border_width">5</property>
+	  <property name="border_width">0</property>
 	  <property name="visible">True</property>
 	  <property name="homogeneous">False</property>
 	  <property name="spacing">6</property>
diff --git a/src/ev-sidebar.c b/src/ev-sidebar.c
index 57ba632..b4576c2 100644
--- a/src/ev-sidebar.c
+++ b/src/ev-sidebar.c
@@ -1,9 +1,11 @@
 /* this file is part of evince, a gnome document viewer
  *
  *  Copyright (C) 2004 Red Hat, Inc.
+ *            (C) 2007 Jan Arne Petersen
  *
- *  Author:
+ *  Authors:
  *    Jonathan Blandford <jrb@alum.mit.edu>
+ *    Jan Arne Petersen <jpetersen@jpetersen.org>
  *
  * Evince is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
@@ -34,31 +36,16 @@
 
 #include "ev-sidebar.h"
 
-typedef struct
-{
-	char *id;
-	char *title;
-	GtkWidget *main_widget;
-} EvSidebarPage;
-
 enum
 {
 	PAGE_COLUMN_ID,
 	PAGE_COLUMN_TITLE,
-	PAGE_COLUMN_MENU_ITEM,
-	PAGE_COLUMN_MAIN_WIDGET,
-	PAGE_COLUMN_NOTEBOOK_INDEX,
 	PAGE_COLUMN_NUM_COLS
 };
 
 struct _EvSidebarPrivate {
+	GtkWidget *combobox;
 	GtkWidget *notebook;
-	GtkWidget *menu;
-	GtkWidget *hbox;
-	GtkWidget *label;
-
-	GtkTreeModel *page_model;
-	char *current;
 };
 
 enum {
@@ -76,16 +63,6 @@ G_DEFINE_TYPE (EvSidebar, ev_sidebar, GTK_TYPE_VBOX)
 static void
 ev_sidebar_destroy (GtkObject *object)
 {
-	EvSidebar *ev_sidebar = EV_SIDEBAR (object);
-
-	g_free (ev_sidebar->priv->current);
-	ev_sidebar->priv->current = NULL;
-
-	if (ev_sidebar->priv->menu) {
-		gtk_menu_detach (GTK_MENU (ev_sidebar->priv->menu));
-		ev_sidebar->priv->menu = NULL;
-	}
-
 	(* GTK_OBJECT_CLASS (ev_sidebar_parent_class)->destroy) (object);
 }
 
@@ -116,78 +93,6 @@ ev_sidebar_class_init (EvSidebarClass *ev_sidebar_class)
 }
 
 static void
-ev_sidebar_menu_position_under (GtkMenu  *menu,
-				int      *x,
-				int      *y,
-				gboolean *push_in,
-				gpointer  user_data)
-{
-	GtkWidget *widget;
-
-	g_return_if_fail (GTK_IS_BUTTON (user_data));
-	g_return_if_fail (GTK_WIDGET_NO_WINDOW (user_data));
-
-	widget = GTK_WIDGET (user_data);
-	   
-	gdk_window_get_origin (widget->window, x, y);
-	   
-	*x += widget->allocation.x;
-	*y += widget->allocation.y + widget->allocation.height;
-	   
-	*push_in = FALSE;
-}
-
-static gboolean
-ev_sidebar_select_button_press_cb (GtkWidget      *widget,
-				   GdkEventButton *event,
-				   gpointer        user_data)
-{
-	EvSidebar *ev_sidebar = EV_SIDEBAR (user_data);
-
-	if (event->button == 1) {
-		GtkRequisition requisition;
-		gint width;
-
-		width = widget->allocation.width;
-		gtk_widget_set_size_request (ev_sidebar->priv->menu, -1, -1);
-		gtk_widget_size_request (ev_sidebar->priv->menu, &requisition);
-		gtk_widget_set_size_request (ev_sidebar->priv->menu,
-				MAX (width, requisition.width), -1);
-		gtk_widget_grab_focus (widget);
-			 
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
-		gtk_menu_popup (GTK_MENU (ev_sidebar->priv->menu),
-				NULL, NULL, ev_sidebar_menu_position_under, widget,
-				event->button, event->time);
-
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
-static gboolean
-ev_sidebar_select_button_key_press_cb (GtkWidget   *widget,
-				       GdkEventKey *event,
-				       gpointer     user_data)
-{
-	EvSidebar *ev_sidebar = EV_SIDEBAR (user_data);
-	   
-	if (event->keyval == GDK_space ||
-	    event->keyval == GDK_KP_Space ||
-	    event->keyval == GDK_Return ||
-	    event->keyval == GDK_KP_Enter) {
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
-		gtk_menu_popup (GTK_MENU (ev_sidebar->priv->menu),
-			        NULL, NULL, ev_sidebar_menu_position_under, widget,
-				1, event->time);
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
-static void
 ev_sidebar_close_clicked_cb (GtkWidget *widget,
 			     gpointer   user_data)
 {
@@ -199,117 +104,70 @@ ev_sidebar_close_clicked_cb (GtkWidget *widget,
 }
 
 static void
-ev_sidebar_menu_deactivate_cb (GtkWidget *widget,
-			       gpointer   user_data)
-{
-	GtkWidget *menu_button;
-
-	menu_button = GTK_WIDGET (user_data);
-	   
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (menu_button), FALSE);
-}
-
-static void
-ev_sidebar_menu_detach_cb (GtkWidget *widget,
-			   GtkMenu   *menu)
-{
-	EvSidebar *ev_sidebar = EV_SIDEBAR (widget);
-	   
-	ev_sidebar->priv->menu = NULL;
-}
-
-static void
-ev_sidebar_menu_item_activate_cb (GtkWidget *widget,
-				  gpointer   user_data)
+ev_sidebar_combobox_changed_cb (GtkComboBox *combo_box,
+				gpointer   user_data)
 {
 	EvSidebar *ev_sidebar = EV_SIDEBAR (user_data);
+	GtkTreeModel *model;
 	GtkTreeIter iter;
-	GtkWidget *menu_item, *item;
-	gchar *title, *page_id;
-	gboolean valid;
-	gint index;
 
-	menu_item = gtk_menu_get_active (GTK_MENU (ev_sidebar->priv->menu));
-	valid = gtk_tree_model_get_iter_first (ev_sidebar->priv->page_model, &iter);
+	model = gtk_combo_box_get_model (combo_box);
 
-	while (valid) {
-		gtk_tree_model_get (ev_sidebar->priv->page_model,
-				    &iter,
-				    PAGE_COLUMN_ID, &page_id,
-				    PAGE_COLUMN_TITLE, &title, 
-				    PAGE_COLUMN_MENU_ITEM, &item,
-				    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
-				    -1);
-
-		if (item == menu_item) {
-			gtk_notebook_set_current_page
-				(GTK_NOTEBOOK (ev_sidebar->priv->notebook), index);
-			gtk_label_set_text (GTK_LABEL (ev_sidebar->priv->label), title);
-			g_free (ev_sidebar->priv->current);
-			ev_sidebar->priv->current = page_id;
-			valid = FALSE;
-		} else {
-			valid = gtk_tree_model_iter_next (ev_sidebar->priv->page_model, &iter);
-			g_free (page_id);
+	if (gtk_combo_box_get_active_iter (combo_box, &iter)) {
+		GtkTreePath *path;
+		gint *indices;
+
+		path = gtk_tree_model_get_path (model, &iter);
+		indices = gtk_tree_path_get_indices (path);
+
+		if (indices != NULL) {
+			gtk_notebook_set_current_page (GTK_NOTEBOOK (ev_sidebar->priv->notebook), indices[0]);
 		}
-		g_object_unref (item);
-		g_free (title);
+
+		gtk_tree_path_free (path);
 	}
 }
 
 static void
 ev_sidebar_init (EvSidebar *ev_sidebar)
 {
+	GtkTreeModel *page_model;
 	GtkWidget *hbox;
 	GtkWidget *close_button;
-	GtkWidget *select_button;
-	GtkWidget *select_hbox;
-	GtkWidget *arrow;
+	GtkCellRenderer *renderer;
 	GtkWidget *image;
 
 	ev_sidebar->priv = EV_SIDEBAR_GET_PRIVATE (ev_sidebar);
 
+	gtk_box_set_spacing (GTK_BOX (ev_sidebar), 6);
+	gtk_container_set_border_width (GTK_CONTAINER (ev_sidebar), 6);
+
 	/* data model */
-	ev_sidebar->priv->page_model = (GtkTreeModel *)
+	page_model = (GtkTreeModel *)
 			gtk_list_store_new (PAGE_COLUMN_NUM_COLS,
 					    G_TYPE_STRING,
 					    G_TYPE_STRING,
 					    GTK_TYPE_WIDGET,
-					    GTK_TYPE_WIDGET,
 					    G_TYPE_INT);
 
 	/* top option menu */
-	hbox = gtk_hbox_new (FALSE, 0);
-	ev_sidebar->priv->hbox = hbox;
+	hbox = gtk_hbox_new (FALSE, 6);
 	gtk_box_pack_start (GTK_BOX (ev_sidebar), hbox, FALSE, FALSE, 0);
 	gtk_widget_show (hbox);
 
-	select_button = gtk_toggle_button_new ();
-	gtk_button_set_relief (GTK_BUTTON (select_button), GTK_RELIEF_NONE);
-	g_signal_connect (select_button, "button_press_event",
-			  G_CALLBACK (ev_sidebar_select_button_press_cb),
-			  ev_sidebar);
-	g_signal_connect (select_button, "key_press_event",
-			  G_CALLBACK (ev_sidebar_select_button_key_press_cb),
+	ev_sidebar->priv->combobox = gtk_combo_box_new_with_model (page_model);
+	g_signal_connect (ev_sidebar->priv->combobox, "changed",
+			  G_CALLBACK (ev_sidebar_combobox_changed_cb),
 			  ev_sidebar);
 
-	select_hbox = gtk_hbox_new (FALSE, 0);
-
-	ev_sidebar->priv->label = gtk_label_new ("");
-	gtk_box_pack_start (GTK_BOX (select_hbox),
-			    ev_sidebar->priv->label,
-			    FALSE, FALSE, 0);
-	gtk_widget_show (ev_sidebar->priv->label);
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (ev_sidebar->priv->combobox), renderer, TRUE);
+	gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (ev_sidebar->priv->combobox), renderer, "text", PAGE_COLUMN_TITLE);
 
-	arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
-	gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0);
-	gtk_widget_show (arrow);
+	gtk_box_pack_start (GTK_BOX (hbox), ev_sidebar->priv->combobox, TRUE, TRUE, 0);
+	gtk_widget_show (ev_sidebar->priv->combobox);
 
-	gtk_container_add (GTK_CONTAINER (select_button), select_hbox);
-	gtk_widget_show (select_hbox);
-
-	gtk_box_pack_start (GTK_BOX (hbox), select_button, TRUE, TRUE, 0);
-	gtk_widget_show (select_button);
+	g_object_unref (G_OBJECT (page_model));
 
 	close_button = gtk_button_new ();
 	gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
@@ -325,15 +183,6 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
 	gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
 	gtk_widget_show (close_button);
    
-	ev_sidebar->priv->menu = gtk_menu_new ();
-	g_signal_connect (ev_sidebar->priv->menu, "deactivate",
-			  G_CALLBACK (ev_sidebar_menu_deactivate_cb),
-			  select_button);
-	gtk_menu_attach_to_widget (GTK_MENU (ev_sidebar->priv->menu),
-				   GTK_WIDGET (ev_sidebar),
-				   ev_sidebar_menu_detach_cb);
-	gtk_widget_show (ev_sidebar->priv->menu);
-
 	ev_sidebar->priv->notebook = gtk_notebook_new ();
 	gtk_notebook_set_show_border (GTK_NOTEBOOK (ev_sidebar->priv->notebook), FALSE);
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (ev_sidebar->priv->notebook), FALSE);
@@ -357,64 +206,67 @@ ev_sidebar_new (void)
 const char *
 ev_sidebar_get_current_page (EvSidebar *ev_sidebar)
 {
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	char *id;
+
 	g_return_val_if_fail (EV_IS_SIDEBAR (ev_sidebar), NULL);
 	g_return_val_if_fail (ev_sidebar->priv != NULL, NULL);
 
-	return ev_sidebar->priv->current;
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (ev_sidebar->priv->combobox));
+
+	if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (ev_sidebar->priv->combobox), &iter)) {
+		gtk_tree_model_get (model, &iter, PAGE_COLUMN_ID, &id, -1);
+
+		return id;
+	}
+
+	return NULL;
 }
 
-static gint
-ev_sidebar_get_index_for_page_id (EvSidebar *ev_sidebar,
-				  const char *new_page_id,
-				  GtkWidget **menu_item_ret)
+static gboolean
+ev_sidebar_get_iter_for_page_id (EvSidebar *ev_sidebar,
+				 const char *new_page_id,
+				 GtkTreeIter *iter)
 {
-	GtkWidget *menu_item;
+	GtkTreeModel *model;
 	gboolean valid;
-	GtkTreeIter iter;
 	gchar *page_id;
-	gint index;
 
-	valid = gtk_tree_model_get_iter_first (ev_sidebar->priv->page_model, &iter);
+	g_return_val_if_fail (EV_IS_SIDEBAR (ev_sidebar), FALSE);
+	g_return_val_if_fail (ev_sidebar->priv != NULL, FALSE);
+	g_return_val_if_fail (iter != NULL, FALSE);
+
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (ev_sidebar->priv->combobox));
+
+	valid = gtk_tree_model_get_iter_first (model, iter);
 
 	while (valid) {
-		gtk_tree_model_get (ev_sidebar->priv->page_model,
-				    &iter,
-				    PAGE_COLUMN_ID, &page_id,
-				    PAGE_COLUMN_MENU_ITEM, &menu_item,
-				    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
-				    -1);
+		gtk_tree_model_get (model, iter, PAGE_COLUMN_ID, &page_id, -1);
 
 		if (page_id != NULL && strcmp (new_page_id, page_id) == 0) {
-			if (menu_item_ret != NULL)
-				*menu_item_ret = menu_item;
 			g_free (page_id);
-			return index;
-		} else {
-			valid = gtk_tree_model_iter_next (ev_sidebar->priv->page_model, &iter);
+			return TRUE;
 		}
-		g_object_unref (menu_item);
 		g_free (page_id);
+
+		valid = gtk_tree_model_iter_next (model, iter);
 	}
 
-	return -1;
+	return FALSE;
 }
 
 void
 ev_sidebar_set_current_page (EvSidebar *ev_sidebar, const char *new_page_id)
 {
-	GtkWidget *menu_item;
-	gint index;
+	GtkTreeIter iter;
 
 	g_return_if_fail (EV_IS_SIDEBAR (ev_sidebar));
 	g_return_if_fail (new_page_id != NULL);
 
-	if (strcmp (new_page_id, ev_sidebar->priv->current) == 0)
-		return;
 
-	index = ev_sidebar_get_index_for_page_id (ev_sidebar, new_page_id, &menu_item);
-	if (index >= 0) {
-		gtk_menu_set_active (GTK_MENU (ev_sidebar->priv->menu), index);
-		gtk_menu_item_activate (GTK_MENU_ITEM (menu_item));
+	if (ev_sidebar_get_iter_for_page_id (ev_sidebar, new_page_id, &iter)) {
+		gtk_combo_box_set_active_iter (GTK_COMBO_BOX (ev_sidebar->priv->combobox), &iter);
 	}
 }
 
@@ -424,55 +276,29 @@ ev_sidebar_add_page (EvSidebar   *ev_sidebar,
 		     const gchar *title,
 		     GtkWidget   *main_widget)
 {
-	GtkTreeIter iter;
-	GtkWidget *menu_item;
-	gchar *label_title, *new_page_id;
-	int index;
+	GtkTreeIter iter, iter2;
+	GtkTreeModel *model;
 	   
 	g_return_if_fail (EV_IS_SIDEBAR (ev_sidebar));
 	g_return_if_fail (page_id != NULL);
 	g_return_if_fail (title != NULL);
 	g_return_if_fail (GTK_IS_WIDGET (main_widget));
 
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (ev_sidebar->priv->combobox));
+
 	gtk_widget_set_sensitive (GTK_WIDGET (ev_sidebar), TRUE);
-   
-	index = gtk_notebook_append_page (GTK_NOTEBOOK (ev_sidebar->priv->notebook),
-					  main_widget, NULL);
-	   
-	menu_item = gtk_image_menu_item_new_with_label (title);
-	g_signal_connect (menu_item, "activate",
-			  G_CALLBACK (ev_sidebar_menu_item_activate_cb),
-			  ev_sidebar);
 
-	gtk_widget_show (menu_item);
-	gtk_menu_shell_append (GTK_MENU_SHELL (ev_sidebar->priv->menu),
-			       menu_item);
+	gtk_widget_show (main_widget);	
+	gtk_notebook_append_page (GTK_NOTEBOOK (ev_sidebar->priv->notebook), main_widget, NULL);
 
-	gtk_list_store_append (GTK_LIST_STORE (ev_sidebar->priv->page_model), &iter);
-	gtk_list_store_set (GTK_LIST_STORE (ev_sidebar->priv->page_model), &iter,
+	gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+	gtk_list_store_set (GTK_LIST_STORE (model), &iter,
 			    PAGE_COLUMN_ID, page_id,
 			    PAGE_COLUMN_TITLE, title,
-			    PAGE_COLUMN_MENU_ITEM, menu_item,
-			    PAGE_COLUMN_MAIN_WIDGET, main_widget,
-			    PAGE_COLUMN_NOTEBOOK_INDEX, index,
 			    -1);
 
-	if (ev_sidebar->priv->current == NULL) {
-		/* Set the first item added as active */
-		gtk_tree_model_get_iter_first (ev_sidebar->priv->page_model, &iter);
-		gtk_tree_model_get (ev_sidebar->priv->page_model,
-				    &iter,
-				    PAGE_COLUMN_ID, &new_page_id,
-				    PAGE_COLUMN_TITLE, &label_title,
-				    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
-				    -1);
-
-		gtk_menu_set_active (GTK_MENU (ev_sidebar->priv->menu), index);
-		gtk_label_set_text (GTK_LABEL (ev_sidebar->priv->label), label_title);
-		gtk_notebook_set_current_page (GTK_NOTEBOOK (ev_sidebar->priv->notebook),
-					       index);
-		ev_sidebar->priv->current = new_page_id;
-		g_free (label_title);
+	if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (ev_sidebar->priv->combobox), &iter2)) {
+		gtk_combo_box_set_active_iter (GTK_COMBO_BOX (ev_sidebar->priv->combobox), &iter);
 	}
 }
 
@@ -481,43 +307,36 @@ ev_sidebar_remove_page (EvSidebar   *ev_sidebar,
 			const gchar *page_id)
 {
 	GtkTreeIter iter;
-	int page_num;
-	char *tree_path, *new_page_id;
-	GtkWidget *menu_item;
-
-	page_num = ev_sidebar_get_index_for_page_id (ev_sidebar, page_id, &menu_item);
-	g_return_if_fail (page_num >= 0);
-
-	gtk_notebook_remove_page (GTK_NOTEBOOK (ev_sidebar->priv->notebook),
-				  page_num);
-	gtk_widget_destroy (menu_item);
-
-	tree_path = g_strdup_printf ("%d", page_num);
-	if (gtk_tree_model_get_iter_from_string (ev_sidebar->priv->page_model,
-						 &iter, tree_path) == FALSE) {
-		g_free (tree_path);
-		return;
-	}
-	g_free (tree_path);
+	GtkTreeModel *model;
+	   
+	g_return_if_fail (EV_IS_SIDEBAR (ev_sidebar));
+	g_return_if_fail (page_id != NULL);
 
-	gtk_list_store_remove (GTK_LIST_STORE (ev_sidebar->priv->page_model), &iter);
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (ev_sidebar->priv->combobox));
 
-	if (gtk_tree_model_iter_n_children (ev_sidebar->priv->page_model, NULL) == 0) {
-		gtk_widget_set_sensitive (GTK_WIDGET (ev_sidebar), FALSE);
-		g_free (ev_sidebar->priv->current);
-		ev_sidebar->priv->current = NULL;
-		return;
-	}
+	if (ev_sidebar_get_iter_for_page_id (ev_sidebar, page_id, &iter)) {
+		GtkTreePath *path;
+		gint *indices;
 
-	tree_path = g_strdup_printf ("%d", page_num - 1);
-	gtk_tree_model_get_iter_from_string (ev_sidebar->priv->page_model, &iter, tree_path);
-	g_free (tree_path);
+		path = gtk_tree_model_get_path (model, &iter);
+		indices = gtk_tree_path_get_indices (path);
 
-	gtk_tree_model_get (ev_sidebar->priv->page_model,
-			    &iter,
-			    PAGE_COLUMN_ID, &new_page_id,
-			    -1);
-	ev_sidebar_set_current_page (ev_sidebar, new_page_id);
-	g_free (new_page_id);
+		g_assert (indices != NULL);
+		gtk_notebook_remove_page (GTK_NOTEBOOK (ev_sidebar->priv->notebook), indices[0]);
+
+		gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
+
+		if (gtk_tree_model_iter_n_children (model, NULL) != 0) {
+			gtk_tree_path_prev (path);
+
+			if (gtk_tree_model_get_iter (model, &iter, path)) {
+				gtk_combo_box_set_active_iter (GTK_COMBO_BOX (ev_sidebar->priv->combobox), &iter);
+			}
+		} else {
+			gtk_widget_set_sensitive (GTK_WIDGET (ev_sidebar), FALSE);
+		}
+
+		gtk_tree_path_free (path);
+	}
 }
 
