diff options
author | Lars Mueller <[email protected]> | 2017-08-30 14:57:59 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-03-16 18:03:35 +0100 |
commit | 7619dc678fcc3e64ccefb0565517ca6f14554550 (patch) | |
tree | e697ff52f46dbbe1f747e57819785362f64dcf52 /shell/ev-window.c | |
parent | 58e7446290d78e0744a5193e22bfa300e6737829 (diff) | |
download | atril-7619dc678fcc3e64ccefb0565517ca6f14554550.tar.bz2 atril-7619dc678fcc3e64ccefb0565517ca6f14554550.tar.xz |
Add zoom reset
origin commit:
https://github.com/linuxmint/xreader/commit/43acb8f
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r-- | shell/ev-window.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c index a8f485dc..e7fc6538 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -575,6 +575,9 @@ ev_window_update_actions (EvWindow *ev_window) has_pages && ev_view_can_zoom_out (view) && !presentation_mode); + ev_window_set_action_sensitive (ev_window, "ViewZoomReset", + has_pages && + !presentation_mode); ev_window_set_action_sensitive (ev_window, "ViewDualOddLeft", dual_mode); } @@ -4725,6 +4728,23 @@ ev_window_cmd_view_zoom_out (GtkAction *action, EvWindow *ev_window) } static void +ev_window_cmd_view_zoom_reset (GtkAction *action, EvWindow *ev_window) +{ + g_return_if_fail (EV_IS_WINDOW (ev_window)); + + ev_document_model_set_sizing_mode (ev_window->priv->model, EV_SIZING_FREE); +#if ENABLE_EPUB + if ( ev_window->priv->document->iswebdocument) { + ev_web_view_zoom_reset(EV_WEB_VIEW(ev_window->priv->webview)); + } + else +#endif + { + ev_view_zoom_reset (EV_VIEW (ev_window->priv->view)); + } +} + +static void ev_window_cmd_go_previous_page (GtkAction *action, EvWindow *ev_window) { g_return_if_fail (EV_IS_WINDOW (ev_window)); @@ -6300,6 +6320,9 @@ static const GtkActionEntry entries[] = { { "ViewZoomOut", "zoom-out", N_("Zoom _Out"), "<control>minus", N_("Shrink the document"), G_CALLBACK (ev_window_cmd_view_zoom_out) }, + { "ViewZoomReset", "zoom-original", N_("_Reset Zoom"), "<control>0", + N_("Reset zoom to 100\%"), + G_CALLBACK (ev_window_cmd_view_zoom_reset) }, { "ViewReload", "view-refresh", N_("_Reload"), "<control>R", N_("Reload the document"), G_CALLBACK (ev_window_cmd_view_reload) }, @@ -6653,6 +6676,10 @@ set_action_properties (GtkActionGroup *action_group) /*translators: this is the label for toolbar button*/ g_object_set (action, "short_label", _("Zoom Out"), NULL); + action = gtk_action_group_get_action (action_group, "ViewZoomReset"); + /*translators: this is the label for toolbar button*/ + g_object_set (action, "short_label", _("Reset Zoom"), NULL); + action = gtk_action_group_get_action (action_group, "ViewFitPage"); /*translators: this is the label for toolbar button*/ g_object_set (action, "short_label", _("Fit Page"), NULL); |