mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 13:46:01 +01:00
Consider page padding in sc_scroll
This commit is contained in:
parent
a91103044f
commit
eac3cbd904
1 changed files with 9 additions and 7 deletions
16
shortcuts.c
16
shortcuts.c
|
@ -379,25 +379,27 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument,
|
||||||
adjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
adjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
||||||
}
|
}
|
||||||
|
|
||||||
gdouble view_size = gtk_adjustment_get_page_size(adjustment);
|
gdouble view_size = gtk_adjustment_get_page_size(adjustment);
|
||||||
gdouble value = gtk_adjustment_get_value(adjustment);
|
gdouble value = gtk_adjustment_get_value(adjustment);
|
||||||
gdouble max = gtk_adjustment_get_upper(adjustment) - view_size;
|
gdouble max = gtk_adjustment_get_upper(adjustment) - view_size;
|
||||||
|
unsigned int padding = zathura->global.page_padding;
|
||||||
|
|
||||||
float scroll_step = 40;
|
float scroll_step = 40;
|
||||||
girara_setting_get(session, "scroll-step", &scroll_step);
|
girara_setting_get(session, "scroll-step", &scroll_step);
|
||||||
gdouble new_value;
|
gdouble new_value;
|
||||||
|
|
||||||
switch(argument->n) {
|
switch(argument->n) {
|
||||||
case FULL_UP:
|
case FULL_UP:
|
||||||
new_value = value - view_size;
|
new_value = value - view_size - padding;
|
||||||
break;
|
break;
|
||||||
case FULL_DOWN:
|
case FULL_DOWN:
|
||||||
new_value = value + view_size;
|
new_value = value + view_size + padding;
|
||||||
break;
|
break;
|
||||||
case HALF_UP:
|
case HALF_UP:
|
||||||
new_value = value - (view_size / 2);
|
new_value = value - ((view_size + padding) / 2);
|
||||||
break;
|
break;
|
||||||
case HALF_DOWN:
|
case HALF_DOWN:
|
||||||
new_value = value + (view_size / 2);
|
new_value = value + ((view_size + padding) / 2);
|
||||||
break;
|
break;
|
||||||
case LEFT:
|
case LEFT:
|
||||||
case UP:
|
case UP:
|
||||||
|
|
Loading…
Reference in a new issue