Make page mode toggling predictable

Previously, toggling page mode would jump to near page, but usually
not the one your were looking at before.
This commit is contained in:
Felix Kaiser 2016-10-15 00:49:21 +02:00
parent 6aa5420f37
commit 2371550807

View File

@ -1224,6 +1224,8 @@ sc_toggle_page_mode(girara_session_t* session, girara_argument_t*
return false;
}
unsigned int page_id = zathura_document_get_current_page_number(zathura->document);
int pages_per_row = 1;
girara_setting_get(zathura->ui.session, "pages-per-row", &pages_per_row);
@ -1237,6 +1239,10 @@ sc_toggle_page_mode(girara_session_t* session, girara_argument_t*
girara_setting_set(zathura->ui.session, "pages-per-row", &value);
adjust_view(zathura);
page_set(zathura, page_id);
render_all(zathura);
refresh_view(zathura);
return true;
}