@@ -450,6 +450,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
450450 ev_window_set_action_sensitive (ev_window , "ViewExpandWindow" , has_pages && !(document -> iswebdocument ));
451451 ev_window_set_action_sensitive (ev_window , "ViewZoomIn" , has_pages && !(document -> iswebdocument ));
452452 ev_window_set_action_sensitive (ev_window , "ViewZoomOut" , has_pages && !(document -> iswebdocument ));
453+ ev_window_set_action_sensitive (ev_window , "ViewZoomReset" , has_pages && !(document -> iswebdocument ));
453454 ev_window_set_action_sensitive (ev_window , "ViewPresentation" , has_pages && !(document -> iswebdocument ));
454455
455456 /* Bookmarks menu */
@@ -527,6 +528,9 @@ ev_window_update_actions (EvWindow *ev_window)
527528 has_pages &&
528529 ev_view_can_zoom_out (view ) &&
529530 !presentation_mode );
531+ ev_window_set_action_sensitive (ev_window , "ViewZoomReset" ,
532+ has_pages &&
533+ !presentation_mode );
530534 }
531535 /* Go menu */
532536 if (has_pages ) {
@@ -4375,6 +4379,23 @@ ev_window_cmd_view_zoom_out (GtkAction *action, EvWindow *ev_window)
43754379 }
43764380}
43774381
4382+ static void
4383+ ev_window_cmd_view_zoom_reset (GtkAction * action , EvWindow * ev_window )
4384+ {
4385+ g_return_if_fail (EV_IS_WINDOW (ev_window ));
4386+
4387+ ev_document_model_set_sizing_mode (ev_window -> priv -> model , EV_SIZING_FREE );
4388+ #if ENABLE_EPUB
4389+ if ( ev_window -> priv -> document -> iswebdocument ) {
4390+ ev_web_view_zoom_reset (EV_WEB_VIEW (ev_window -> priv -> webview ));
4391+ }
4392+ else
4393+ #endif
4394+ {
4395+ ev_view_zoom_reset (EV_VIEW (ev_window -> priv -> view ));
4396+ }
4397+ }
4398+
43784399static void
43794400ev_window_cmd_go_previous_page (GtkAction * action , EvWindow * ev_window )
43804401{
@@ -5803,6 +5824,9 @@ static const GtkActionEntry entries[] = {
58035824
58045825
58055826 /* View menu */
5827+ { "ViewZoomReset" , "zoom-original-symbolic" , N_ ("_Reset Zoom" ), "<control>0" ,
5828+ N_ ("Reset zoom to 100\%" ),
5829+ G_CALLBACK (ev_window_cmd_view_zoom_reset ) },
58065830 { "ViewZoomIn" , "zoom-in-symbolic" , N_ ("Zoom _In" ), "<control>plus" ,
58075831 N_ ("Enlarge the document" ),
58085832 G_CALLBACK (ev_window_cmd_view_zoom_in ) },
@@ -6121,6 +6145,10 @@ set_action_properties (GtkActionGroup *action_group)
61216145 action = gtk_action_group_get_action (action_group , "ViewZoomOut" );
61226146 /*translators: this is the label for toolbar button*/
61236147 g_object_set (action , "short_label" , _ ("Zoom Out" ), NULL );
6148+
6149+ action = gtk_action_group_get_action (action_group , "ViewZoomReset" );
6150+ /*translators: this is the label for toolbar button*/
6151+ g_object_set (action , "short_label" , _ ("Reset Zoom" ), NULL );
61246152
61256153 action = gtk_action_group_get_action (action_group , "ViewBestFit" );
61266154 /*translators: this is the label for toolbar button*/
0 commit comments