mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 23:24:24 +01:00
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
This commit is contained in:
parent
2371550807
commit
49e96c68e5
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user