From 7841eea2ebd37756c3e0f09e0ba584d566e9862d Mon Sep 17 00:00:00 2001 From: Marwan Tanager Date: Sun, 3 Mar 2013 03:11:48 +0200 Subject: [PATCH] Scale vertical/horizontal scrolling by the contents of the numeric buffer. Signed-off-by: Sebastian Ramacher --- shortcuts.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 44b790f..4821895 100644 --- a/shortcuts.c +++ b/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;