summaryrefslogtreecommitdiff
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-10 01:46:40 +0100
committerinfirit <[email protected]>2014-12-10 01:46:40 +0100
commit792b694b94965150f845fc3a940ee7c72b1d5b94 (patch)
tree7888d748dc72b6d9c06a111c025a123c05956369 /shell/ev-window.c
parent8389b5ec0106f63fbe04c42bd9f120f67ec3d078 (diff)
downloadatril-792b694b94965150f845fc3a940ee7c72b1d5b94.tar.bz2
atril-792b694b94965150f845fc3a940ee7c72b1d5b94.tar.xz
Rotate with CTRL+Left/Right in presentation mode too
Taken from evince commit: edf80d6543a90f386f34c37d35998cd286736263 From: Carlos Garcia Campos <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=641772
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 368c8881..6e01708f 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4180,12 +4180,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);
@@ -4370,17 +4373,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;
- 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