X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-window.c;h=ee6160b79f20dd581b2cdcad809210cd63b562c8;hb=c935a25cdd0c9791158b1252835142472152d6cc;hp=4d2283b043b2b7ad2249018b8ec64c53b204b8fc;hpb=53eea4249bc0255faa1bf51cb4fb455db4cc69f1;p=evince.git diff --git a/shell/ev-window.c b/shell/ev-window.c index 4d2283b0..ee6160b7 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -442,6 +442,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) ev_window_set_action_sensitive (ev_window, "FileSaveAs", has_document && ok_to_copy); ev_window_set_action_sensitive (ev_window, "FilePrint", has_pages && ok_to_print); ev_window_set_action_sensitive (ev_window, "FileProperties", has_document && has_properties); + ev_window_set_action_sensitive (ev_window, "FileOpenContainingFolder", has_document); /* Edit menu */ ev_window_set_action_sensitive (ev_window, "EditSelectAll", has_pages && can_get_text); @@ -3975,6 +3976,22 @@ ev_window_view_presentation_finished (EvWindow *window) ev_window_stop_presentation (window, TRUE); } +static gboolean +ev_window_view_presentation_focus_in (EvWindow *window) +{ + ev_application_screensaver_disable (EV_APP); + + return FALSE; +} + +static gboolean +ev_window_view_presentation_focus_out (EvWindow *window) +{ + ev_application_screensaver_enable (EV_APP); + + return FALSE; +} + static void ev_window_run_presentation (EvWindow *window) { @@ -4004,6 +4021,12 @@ ev_window_run_presentation (EvWindow *window) g_signal_connect_swapped (window->priv->presentation_view, "external-link", G_CALLBACK (view_external_link_cb), window); + g_signal_connect_swapped (window->priv->presentation_view, "focus-in-event", + G_CALLBACK (ev_window_view_presentation_focus_in), + window); + g_signal_connect_swapped (window->priv->presentation_view, "focus-out-event", + G_CALLBACK (ev_window_view_presentation_focus_out), + window); gtk_box_pack_start (GTK_BOX (window->priv->main_box), window->priv->presentation_view, @@ -4030,12 +4053,15 @@ ev_window_stop_presentation (EvWindow *window, gboolean unfullscreen_window) { guint current_page; + guint rotation; if (!EV_WINDOW_IS_PRESENTATION (window)) return; current_page = ev_view_presentation_get_current_page (EV_VIEW_PRESENTATION (window->priv->presentation_view)); ev_document_model_set_page (window->priv->model, current_page); + rotation = ev_view_presentation_get_rotation (EV_VIEW_PRESENTATION (window->priv->presentation_view)); + ev_document_model_set_rotation (window->priv->model, rotation); gtk_container_remove (GTK_CONTAINER (window->priv->main_box), window->priv->presentation_view); @@ -4207,17 +4233,33 @@ ev_window_set_page_mode (EvWindow *window, static void ev_window_cmd_edit_rotate_left (GtkAction *action, EvWindow *ev_window) { - gint rotation = ev_document_model_get_rotation (ev_window->priv->model); + gint rotation; - ev_document_model_set_rotation (ev_window->priv->model, rotation - 90); + if (EV_WINDOW_IS_PRESENTATION (ev_window)) { + rotation = ev_view_presentation_get_rotation (EV_VIEW_PRESENTATION (ev_window->priv->presentation_view)); + ev_view_presentation_set_rotation (EV_VIEW_PRESENTATION (ev_window->priv->presentation_view), + rotation - 90); + } else { + rotation = ev_document_model_get_rotation (ev_window->priv->model); + + ev_document_model_set_rotation (ev_window->priv->model, rotation - 90); + } } static void ev_window_cmd_edit_rotate_right (GtkAction *action, EvWindow *ev_window) { - gint rotation = ev_document_model_get_rotation (ev_window->priv->model); + gint rotation; + + if (EV_WINDOW_IS_PRESENTATION (ev_window)) { + rotation = ev_view_presentation_get_rotation (EV_VIEW_PRESENTATION (ev_window->priv->presentation_view)); + ev_view_presentation_set_rotation (EV_VIEW_PRESENTATION (ev_window->priv->presentation_view), + rotation + 90); + } else { + rotation = ev_document_model_get_rotation (ev_window->priv->model); - ev_document_model_set_rotation (ev_window->priv->model, rotation + 90); + ev_document_model_set_rotation (ev_window->priv->model, rotation + 90); + } } static void @@ -4275,7 +4317,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); @@ -4854,6 +4896,8 @@ ev_window_sidebar_visibility_changed_cb (EvSidebar *ev_sidebar, if (ev_window->priv->metadata) ev_metadata_set_boolean (ev_window->priv->metadata, "sidebar_visibility", visible); + if (!visible) + gtk_widget_grab_focus (ev_window->priv->view); } } @@ -7091,6 +7135,10 @@ ev_window_init (EvWindow *ev_window) NULL)); g_object_unref (toolbars_model); + gtk_style_context_add_class + (gtk_widget_get_style_context (GTK_WIDGET (ev_window->priv->toolbar)), + GTK_STYLE_CLASS_PRIMARY_TOOLBAR); + egg_editable_toolbar_show (EGG_EDITABLE_TOOLBAR (ev_window->priv->toolbar), "DefaultToolBar"); gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box),