mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:26:01 +01:00
get rid of a couple of static variables to remember adjustment.
Now the document object remembers it! and refresh_view is the one who restores the position.
This commit is contained in:
parent
e51a3265b6
commit
ab9338cb33
1 changed files with 2 additions and 12 deletions
14
shortcuts.c
14
shortcuts.c
|
@ -1115,24 +1115,14 @@ sc_toggle_index(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
|||
gtk_widget_show(treeview);
|
||||
}
|
||||
|
||||
static double vvalue = 0;
|
||||
static double hvalue = 0;
|
||||
|
||||
if (gtk_widget_get_visible(GTK_WIDGET(zathura->ui.index))) {
|
||||
girara_set_view(session, zathura->ui.page_widget_alignment);
|
||||
gtk_widget_hide(GTK_WIDGET(zathura->ui.index));
|
||||
girara_mode_set(zathura->ui.session, zathura->modes.normal);
|
||||
|
||||
/* reset adjustment */
|
||||
position_set(zathura, hvalue, vvalue);
|
||||
/* refresh view */
|
||||
refresh_view(zathura);
|
||||
} else {
|
||||
/* save adjustment */
|
||||
GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
||||
GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
||||
|
||||
vvalue = gtk_adjustment_get_value(vadjustment);
|
||||
hvalue = gtk_adjustment_get_value(hadjustment);
|
||||
|
||||
/* save current position to the jumplist */
|
||||
zathura_jumplist_add(zathura);
|
||||
|
||||
|
|
Loading…
Reference in a new issue