Commit 01b5750b authored by Sebastian Ramacher's avatar Sebastian Ramacher

Add setting to ignore page number stored in file info. (Closes: #145)

Thanks for the patch to Urchlay.
parent 59f27880
......@@ -97,6 +97,8 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "show-hidden", &bool_value, BOOLEAN, false, _("Show hidden files and directories"), NULL, NULL);
bool_value = true;
girara_setting_add(gsession, "show-directories", &bool_value, BOOLEAN, false, _("Show directories"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "open-first-page", &bool_value, BOOLEAN, false, _("Always open on first page"), NULL, NULL);
/* define default shortcuts */
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, 0, 0, NULL);
......
......@@ -330,6 +330,13 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
document->pages[page_id] = page;
}
/* jump to first page if setting enabled */
bool always_first_page = false;
girara_setting_get(zathura->ui.session, "open-first-page", &always_first_page);
if (always_first_page) {
document->current_page_number = 0;
}
/* apply open adjustment */
char* adjust_open = "best-fit";
document->adjust_mode = ADJUST_BESTFIT;
......
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