Commit d76e33e3 authored by Jonas Hoersch's avatar Jonas Hoersch Committed by Sebastian Ramacher
Browse files

Add full page scroll overlap setting



The default of 0.1 keeps 10% of a page visible on a full-page scroll.

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 269580c5
......@@ -145,6 +145,8 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "scroll-step", &float_value, FLOAT, false, _("Scroll step"), NULL, NULL);
float_value = -1;
girara_setting_add(gsession, "scroll-hstep", &float_value, FLOAT, false, _("Horizontal scroll step"), NULL, NULL);
float_value = 0.1;
girara_setting_add(gsession, "scroll-full-overlap", &float_value, FLOAT, false, _("Full page scroll overlap"), NULL, NULL);
int_value = 10;
girara_setting_add(gsession, "zoom-min", &int_value, INT, false, _("Zoom minimum"), NULL, NULL);
int_value = 1000;
......
......@@ -563,6 +563,9 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument,
if (scroll_hstep < 0) {
scroll_hstep = scroll_step;
}
float scroll_full_overlap = 0.1;
girara_setting_get(session, "scroll-full-overlap", &scroll_full_overlap);
int padding = 1;
girara_setting_get(session, "page-padding", &padding);
......@@ -571,11 +574,11 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument,
switch(argument->n) {
case FULL_UP:
case FULL_LEFT:
new_value = value - view_size - padding;
new_value = value - (1.0 - scroll_full_overlap) * view_size - padding;
break;
case FULL_DOWN:
case FULL_RIGHT:
new_value = value + view_size + padding;
new_value = value + (1.0 - scroll_full_overlap) * view_size + padding;
break;
case HALF_UP:
case HALF_LEFT:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment