]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
Make the toolbar editor fill its window
[evince.git] / shell / ev-window.c
index 3c41017d46c141b4d1d1f2981acc8fa468516b40..906adb07992a4b3a5edd3c0104e94253cb4922dc 100644 (file)
@@ -1466,8 +1466,15 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document)
        }
 
        if (EV_WINDOW_IS_PRESENTATION (ev_window)) {
+               gint current_page;
+
+               current_page = ev_view_presentation_get_current_page (
+                       EV_VIEW_PRESENTATION (ev_window->priv->presentation_view));
                gtk_widget_destroy (ev_window->priv->presentation_view);
                ev_window->priv->presentation_view = NULL;
+
+               /* Update the model with the current presentation page */
+               ev_document_model_set_page (ev_window->priv->model, current_page);
                ev_window_run_presentation (ev_window);
        }
 
@@ -4268,7 +4275,7 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window)
        gtk_container_set_border_width (GTK_CONTAINER (editor), 5);
        gtk_box_set_spacing (GTK_BOX (EGG_TOOLBAR_EDITOR (editor)), 5);
 
-       gtk_container_add (GTK_CONTAINER (content_area), editor);
+        gtk_box_pack_start (GTK_BOX (content_area), editor, TRUE, TRUE, 0);
 
        egg_editable_toolbar_set_edit_mode (toolbar, TRUE);
 
@@ -6702,9 +6709,15 @@ ev_window_media_player_key_pressed (EvWindow    *window,
        if (strcmp (key, "Play") == 0) {
                ev_window_run_presentation (window);
        } else if (strcmp (key, "Previous") == 0) {
-               ev_window_cmd_go_previous_page (NULL, window);
+               if (EV_WINDOW_IS_PRESENTATION (window))
+                       ev_view_presentation_previous_page (EV_VIEW_PRESENTATION (window->priv->presentation_view));
+               else
+                       ev_window_cmd_go_previous_page (NULL, window);
        } else if (strcmp (key, "Next") == 0) {
-               ev_window_cmd_go_next_page (NULL, window);
+               if (EV_WINDOW_IS_PRESENTATION (window))
+                       ev_view_presentation_next_page (EV_VIEW_PRESENTATION (window->priv->presentation_view));
+               else
+                       ev_window_cmd_go_next_page (NULL, window);
        } else if (strcmp (key, "FastForward") == 0) {
                ev_window_cmd_go_last_page (NULL, window);
        } else if (strcmp (key, "Rewind") == 0) {