Merge branch 'develop' of pwmt.org:zathura into develop

This commit is contained in:
Sebastian Ramacher 2012-06-27 21:20:08 +02:00
commit db459fe3d9
2 changed files with 16 additions and 6 deletions

View File

@ -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_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, NORMAL, ZOOM_ORIGINAL, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_equal, NULL, sc_zoom, FULLSCREEN, 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, 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, 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, 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, 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, NORMAL, ZOOM_ORIGINAL, NULL);
girara_shortcut_add(gsession, 0, 0, "z0", sc_zoom, FULLSCREEN, 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, 0, "zz", 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, 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 */ /* mouse events */
girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_UP, UP, NULL); girara_mouse_event_add(gsession, 0, 0, sc_mouse_scroll, NORMAL, GIRARA_EVENT_SCROLL_UP, UP, NULL);

View File

@ -988,8 +988,8 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
int value = 1; int value = 1;
girara_setting_get(zathura->ui.session, "zoom-step", &value); girara_setting_get(zathura->ui.session, "zoom-step", &value);
t = (t == 0) ? 1 : t; int nt = (t == 0) ? 1 : t;
float zoom_step = value / 100.0f * t; float zoom_step = value / 100.0f * nt;
float old_zoom = zathura_document_get_scale(zathura->document); float old_zoom = zathura_document_get_scale(zathura->document);
/* specify new zoom value */ /* 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) { } else if (argument->n == ZOOM_OUT) {
zathura_document_set_scale(zathura->document, old_zoom - zoom_step); zathura_document_set_scale(zathura->document, old_zoom - zoom_step);
} else if (argument->n == ZOOM_SPECIFIC) { } 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 { } else {
zathura_document_set_scale(zathura->document, 1.0); zathura_document_set_scale(zathura->document, t / 100.0f);
}
} else {
zathura_document_set_scale(zathura->document, 1.0f);
} }
/* zoom limitations */ /* zoom limitations */