Commit 49e96c68 authored by Felix Kaiser's avatar Felix Kaiser

Make clicking a page set the current page number

This allows fast visual navigation through the 'd'ouble page
shortcut in combination with a high pages-per-row setting.

Resolves #635
parent 23715508
......@@ -634,12 +634,20 @@ void
cb_page_widget_scaled_button_release(ZathuraPage* page_widget, GdkEventButton* event,
void* data)
{
zathura_t* zathura = data;
zathura_page_t* page = zathura_page_widget_get_page(page_widget);
/* set page number (but don't scroll there. it was clicked on, so it's visible) */
if (event->button == 1) {
zathura_document_set_current_page_number(zathura->document, zathura_page_get_index(page));
refresh_view(zathura);
}
if (event->button != 1 || !(event->state & GDK_CONTROL_MASK)) {
return;
}
zathura_t* zathura = data;
bool synctex = false;
girara_setting_get(zathura->ui.session, "synctex", &synctex);
......@@ -647,8 +655,6 @@ cb_page_widget_scaled_button_release(ZathuraPage* page_widget, GdkEventButton* e
return;
}
zathura_page_t* page = zathura_page_widget_get_page(page_widget);
if (zathura->dbus != NULL) {
zathura_dbus_edit(zathura->dbus, zathura_page_get_index(page), event->x, event->y);
}
......
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