Commit 7841eea2 authored by Marwan Tanager's avatar Marwan Tanager Committed by Sebastian Ramacher
Browse files

Scale vertical/horizontal scrolling by the contents of the numeric buffer.


Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 438c9cdc
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment