diff options
author | Carlos Garcia Campos <[email protected]> | 2012-11-25 11:53:10 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-31 13:28:20 +0200 |
commit | ad4ce2cbce9cf6a25082118b3380fc64555d9fb7 (patch) | |
tree | d9e57e0f04a5ce780e7c2e8f189b4822bbda879a | |
parent | 5410b0b58c8c16e2e7ec5fdc8347f2191c4bc74c (diff) | |
download | atril-ad4ce2cbce9cf6a25082118b3380fc64555d9fb7.tar.bz2 atril-ad4ce2cbce9cf6a25082118b3380fc64555d9fb7.tar.xz |
Move dual page with odd pages left to the view menu
As a toggle option only available in dual mode.
origin commit:
https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=1078b8f
-rw-r--r-- | libview/ev-document-model.c | 10 | ||||
-rw-r--r-- | libview/ev-view.c | 9 | ||||
-rw-r--r-- | shell/ev-window.c | 13 |
3 files changed, 10 insertions, 22 deletions
diff --git a/libview/ev-document-model.c b/libview/ev-document-model.c index 572f5526..856ee36e 100644 --- a/libview/ev-document-model.c +++ b/libview/ev-document-model.c @@ -559,11 +559,6 @@ ev_document_model_set_dual_page (EvDocumentModel *model, model->dual_page = dual_page; g_object_notify (G_OBJECT (model), "dual-page"); - - if (dual_page && model->dual_page_odd_left) { - model->dual_page_odd_left = FALSE; - g_object_notify (G_OBJECT (model), "dual-odd-left"); - } } gboolean @@ -588,11 +583,6 @@ ev_document_model_set_dual_page_odd_pages_left (EvDocumentModel *model, model->dual_page_odd_left = odd_left; g_object_notify (G_OBJECT (model), "dual-odd-left"); - - if (odd_left && model->dual_page) { - model->dual_page = FALSE; - g_object_notify (G_OBJECT (model), "dual-page"); - } } gboolean diff --git a/libview/ev-view.c b/libview/ev-view.c index 80f1df48..72abcb86 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -5708,9 +5708,7 @@ ev_view_dual_page_changed_cb (EvDocumentModel *model, GParamSpec *pspec, EvView *view) { - gboolean dual_page = ev_document_model_get_dual_page (model); - - view->dual_page = dual_page || ev_document_model_get_dual_page_odd_pages_left (model); + view->dual_page = ev_document_model_get_dual_page (model); view->pending_scroll = SCROLL_TO_PAGE_POSITION; /* FIXME: if we're keeping the pixbuf cache around, we should extend the * preload_cache_size to be 2 if dual_page is set. @@ -5723,10 +5721,7 @@ ev_view_dual_odd_left_changed_cb (EvDocumentModel *model, GParamSpec *pspec, EvView *view) { - gboolean dual_odd_left = ev_document_model_get_dual_page_odd_pages_left (model); - - view->dual_page = dual_odd_left || ev_document_model_get_dual_page (model); - view->dual_even_left = !dual_odd_left; + view->dual_even_left = !ev_document_model_get_dual_page_odd_pages_left (model); view->pending_scroll = SCROLL_TO_PAGE_POSITION; gtk_widget_queue_resize (GTK_WIDGET (view)); diff --git a/shell/ev-window.c b/shell/ev-window.c index b33637bd..d91344f2 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -525,11 +525,13 @@ ev_window_update_actions (EvWindow *ev_window) gboolean presentation_mode; gboolean can_find_in_page = FALSE; EvSizingMode sizing_mode; + gboolean dual_mode = FALSE; if (ev_window->priv->document) { page = ev_document_model_get_page (ev_window->priv->model); n_pages = ev_document_get_n_pages (ev_window->priv->document); has_pages = n_pages > 0; + dual_mode = ev_document_model_get_dual_page (ev_window->priv->model); } #if ENABLE_EPUB if (ev_window->priv->document && ev_window->priv->document->iswebdocument == TRUE ) { @@ -576,6 +578,8 @@ ev_window_update_actions (EvWindow *ev_window) has_pages && ev_view_can_zoom_out (view) && !presentation_mode); + ev_window_set_action_sensitive (ev_window, "ViewDualOddLeft", + dual_mode); } /* Go menu */ if (has_pages) { @@ -3953,7 +3957,6 @@ ev_window_cmd_dual_odd_pages_left (GtkAction *action, EvWindow *ev_window) { gboolean dual_page_odd_left; - ev_window_stop_presentation (ev_window, TRUE); dual_page_odd_left = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); ev_document_model_set_dual_page_odd_pages_left (ev_window->priv->model, dual_page_odd_left); @@ -6307,11 +6310,11 @@ static const GtkToggleActionEntry toggle_entries[] = { { "ViewContinuous", EV_STOCK_VIEW_CONTINUOUS, N_("_Continuous"), NULL, N_("Show the entire document"), G_CALLBACK (ev_window_cmd_continuous), TRUE }, - { "ViewDual", EV_STOCK_VIEW_DUAL, N_("_Dual (Even pages left)"), NULL, - N_("Show two pages at once with even pages on the left"), + { "ViewDual", EV_STOCK_VIEW_DUAL, N_("_Dual"), NULL, + N_("Show two pages at once"), G_CALLBACK (ev_window_cmd_dual), FALSE }, - { "ViewDualOddLeft", EV_STOCK_VIEW_DUAL, N_("Dual (_Odd pages left)"), NULL, - N_("Show two pages at once with odd pages on the left"), + { "ViewDualOddLeft", NULL, N_("_Odd pages left"), NULL, + N_("Show odd pages on the left in dual mode"), G_CALLBACK (ev_window_cmd_dual_odd_pages_left), FALSE }, { "ViewFullscreen", GTK_STOCK_FULLSCREEN, N_("_Fullscreen"), "F11", N_("Expand the window to fill the screen"), |