diff --git a/config.c b/config.c index ef86f8d..29dccbf 100644 --- a/config.c +++ b/config.c @@ -248,14 +248,20 @@ config_load_default(zathura_t* zathura) girara_shortcut_add(gsession, 0, GDK_KEY_minus, NULL, sc_zoom, FULLSCREEN, ZOOM_OUT, NULL); girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, NORMAL, ZOOM_ORIGINAL, NULL); girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, FULLSCREEN, ZOOM_ORIGINAL, NULL); + girara_shortcut_add(gsession, 0, 0, "zi", sc_zoom, NORMAL, ZOOM_IN, NULL); + girara_shortcut_add(gsession, 0, 0, "zi", sc_zoom, FULLSCREEN, ZOOM_IN, NULL); girara_shortcut_add(gsession, 0, 0, "zI", sc_zoom, NORMAL, ZOOM_IN, NULL); girara_shortcut_add(gsession, 0, 0, "zI", sc_zoom, FULLSCREEN, ZOOM_IN, NULL); + girara_shortcut_add(gsession, 0, 0, "zo", sc_zoom, NORMAL, ZOOM_OUT, NULL); + girara_shortcut_add(gsession, 0, 0, "zo", sc_zoom, FULLSCREEN, ZOOM_OUT, NULL); girara_shortcut_add(gsession, 0, 0, "zO", sc_zoom, NORMAL, ZOOM_OUT, NULL); girara_shortcut_add(gsession, 0, 0, "zO", sc_zoom, FULLSCREEN, ZOOM_OUT, NULL); girara_shortcut_add(gsession, 0, 0, "z0", sc_zoom, NORMAL, ZOOM_ORIGINAL, NULL); girara_shortcut_add(gsession, 0, 0, "z0", sc_zoom, FULLSCREEN, ZOOM_ORIGINAL, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, NORMAL, ZOOM_SPECIFIC, NULL); - girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL); + girara_shortcut_add(gsession, 0, 0, "zz", sc_zoom, NORMAL, ZOOM_SPECIFIC, NULL); + girara_shortcut_add(gsession, 0, 0, "zz", sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL); + girara_shortcut_add(gsession, 0, 0, "zZ", sc_zoom, NORMAL, ZOOM_SPECIFIC, NULL); + girara_shortcut_add(gsession, 0, 0, "zZ", sc_zoom, FULLSCREEN, ZOOM_SPECIFIC, NULL); /* mouse events */ girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_UP, UP, NULL); diff --git a/shortcuts.c b/shortcuts.c index 2e6dec2..67cf388 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -988,8 +988,8 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* int value = 1; girara_setting_get(zathura->ui.session, "zoom-step", &value); - t = (t == 0) ? 1 : t; - float zoom_step = value / 100.0f * t; + int nt = (t == 0) ? 1 : t; + float zoom_step = value / 100.0f * nt; float old_zoom = zathura_document_get_scale(zathura->document); /* specify new zoom value */ @@ -998,9 +998,13 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* } else if (argument->n == ZOOM_OUT) { zathura_document_set_scale(zathura->document, old_zoom - zoom_step); } else if (argument->n == ZOOM_SPECIFIC) { - zathura_document_set_scale(zathura->document, t / 100.0f); + if (t == 0) { + zathura_document_set_scale(zathura->document, 1.0f); + } else { + zathura_document_set_scale(zathura->document, t / 100.0f); + } } else { - zathura_document_set_scale(zathura->document, 1.0); + zathura_document_set_scale(zathura->document, 1.0f); } /* zoom limitations */