refresh horizontal position in page_set

After page_set cb_view_hadjustment_changed must be called so that when
zoom-center is enabled, the page is recentered.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Abdo Roig-Maranges 2013-07-06 21:55:35 +02:00 committed by Sebastian Ramacher
parent 7f42ccbdad
commit 7cdd1e7719
2 changed files with 3 additions and 7 deletions

View file

@ -333,9 +333,6 @@ sc_goto(girara_session_t* session, girara_argument_t* argument, girara_event_t*
page_set(zathura, zathura_document_get_number_of_pages(zathura->document) - 1);
}
/* adjust horizontal position */
GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
cb_view_hadjustment_changed(hadjustment, zathura);
zathura_jumplist_add(zathura);
return false;
@ -472,10 +469,6 @@ sc_navigate(girara_session_t* session, girara_argument_t* argument,
page_set(zathura, new_page);
/* adjust horizontal position */
GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
cb_view_hadjustment_changed(hadjustment, zathura);
return false;
}

View file

@ -1031,6 +1031,9 @@ page_set(zathura_t* zathura, unsigned int page_id)
zathura_adjustment_set_value(view_hadjustment, offset.x);
zathura_adjustment_set_value(view_vadjustment, offset.y);
/* refresh horizontal adjustment, to honor zoom-center */
cb_view_hadjustment_changed(view_hadjustment, zathura);
statusbar_page_number_update(zathura);
return true;