mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 07:13:47 +01:00
Scale vertical/horizontal scrolling by the contents of the numeric buffer.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
438c9cdc9f
commit
7841eea2eb
14
shortcuts.c
14
shortcuts.c
@ -551,7 +551,7 @@ sc_rotate(girara_session_t* session, girara_argument_t* argument,
|
||||
|
||||
bool
|
||||
sc_scroll(girara_session_t* session, girara_argument_t* argument,
|
||||
girara_event_t* UNUSED(event), unsigned int UNUSED(t))
|
||||
girara_event_t* UNUSED(event), unsigned int t)
|
||||
{
|
||||
g_return_val_if_fail(session != NULL, false);
|
||||
g_return_val_if_fail(session->global.data != NULL, false);
|
||||
@ -561,6 +561,10 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!t){
|
||||
t = 1;
|
||||
}
|
||||
|
||||
GtkAdjustment* adjustment = NULL;
|
||||
if ( (argument->n == LEFT) || (argument->n == FULL_LEFT) || (argument->n == HALF_LEFT) ||
|
||||
(argument->n == RIGHT) || (argument->n == FULL_RIGHT) || (argument->n == HALF_RIGHT)) {
|
||||
@ -612,16 +616,16 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument,
|
||||
new_value = value + ((view_size + padding) / 2);
|
||||
break;
|
||||
case LEFT:
|
||||
new_value = value - scroll_hstep;
|
||||
new_value = value - scroll_hstep * t;
|
||||
break;
|
||||
case UP:
|
||||
new_value = value - scroll_step;
|
||||
new_value = value - scroll_step * t;
|
||||
break;
|
||||
case RIGHT:
|
||||
new_value = value + scroll_hstep;
|
||||
new_value = value + scroll_hstep * t;
|
||||
break;
|
||||
case DOWN:
|
||||
new_value = value + scroll_step;
|
||||
new_value = value + scroll_step * t;
|
||||
break;
|
||||
case TOP:
|
||||
new_value = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user