mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 22:43:46 +01:00
Merge branch 'develop' of pwmt.org:zathura into develop
This commit is contained in:
commit
db459fe3d9
10
config.c
10
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_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);
|
||||||
|
12
shortcuts.c
12
shortcuts.c
@ -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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user