Commit 2adb2522 authored by Moritz Lipp's avatar Moritz Lipp

Options for zoom_min/zoom_max

parent 04351355
......@@ -48,6 +48,10 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "pages-per-row", &int_value, INT, false, "Number of pages per row", cb_pages_per_row_value_changed, zathura);
float_value = 40;
girara_setting_add(gsession, "scroll-step", &float_value, FLOAT, false, "Scroll step", NULL, NULL);
int_value = 10;
girara_setting_add(gsession, "zoom-min", &int_value, INT, false, "Zoom minimum", NULL, NULL);
int_value = 1000;
girara_setting_add(gsession, "zoom-max", &int_value, INT, false, "Zoom maximum", NULL, NULL);
string_value = "#FFFFFF";
girara_setting_add(gsession, "recolor-darkcolor", string_value, STRING, false, "Recoloring (dark color)", NULL, NULL);
......
......@@ -787,10 +787,18 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
}
/* zoom limitations */
if (zathura->document->scale < 0.1f) {
zathura->document->scale = 0.1f;
} else if (zathura->document->scale > 10.0f) {
zathura->document->scale = 10.0f;
int zoom_min_int = 10;
int zoom_max_int = 1000;
girara_setting_get(session, "zoom-min", &zoom_min_int);
girara_setting_get(session, "zoom-max", &zoom_max_int);
float zoom_min = zoom_min_int * 0.01f;
float zoom_max = zoom_max_int * 0.01f;
if (zathura->document->scale < zoom_min) {
zathura->document->scale = zoom_min;
} else if (zathura->document->scale > zoom_max) {
zathura->document->scale = zoom_max;
}
/* keep position */
......
Markdown is supported
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