From 9dbcd20a5c3c788e4e9fcaefa01fc7cbaafd7c68 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 8 Nov 2009 16:11:39 +0100 Subject: scroll stuff: update unit tests + remove bindings that (may) conflict with keycmd or are not needed + better default behavior for pageup and pagedown --- examples/config/uzbl/config | 10 ++-------- tests/test-command.c | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/examples/config/uzbl/config b/examples/config/uzbl/config index 7668963..32bb13c 100644 --- a/examples/config/uzbl/config +++ b/examples/config/uzbl/config @@ -114,19 +114,13 @@ set socket_dir = /tmp # a colon. @bind :_ = chain '%s' @bind j = scroll vertical 20 -@bind = scroll vertical 20 -@bind = scroll vertical 500 +@bind = scroll vertical 100% @bind k = scroll vertical -20 -@bind = scroll vertical -20 -@bind = scroll vertical -500 +@bind = scroll vertical -100% @bind h = scroll horizontal -20 -@bind = scroll horizontal -20 @bind l = scroll horizontal 20 -@bind = scroll horizontal 20 @bind << = scroll vertical begin -@bind = scroll vertical begin @bind >> = scroll vertical end -@bind = scroll vertical end @bind ^ = scroll horizontal begin @bind $ = scroll horizontal end @bind b = back diff --git a/tests/test-command.c b/tests/test-command.c index 9275d68..769a1a9 100644 --- a/tests/test-command.c +++ b/tests/test-command.c @@ -250,27 +250,27 @@ test_scroll (void) { gtk_adjustment_set_upper(uzbl.gui.bar_v, 100); gtk_adjustment_set_page_size(uzbl.gui.bar_v, 5); - /* scroll_end should scroll it to upper - page_size */ - parse_cmd_line("scroll_end", NULL); + /* scroll vertical end should scroll it to upper - page_size */ + parse_cmd_line("scroll vertical end", NULL); g_assert_cmpfloat(gtk_adjustment_get_value(uzbl.gui.bar_v), ==, 95); - /* scroll_begin should scroll it to lower */ - parse_cmd_line("scroll_begin", NULL); + /* scroll vertical begin should scroll it to lower */ + parse_cmd_line("scroll vertical begin", NULL); g_assert_cmpfloat(gtk_adjustment_get_value(uzbl.gui.bar_v), ==, 0); - /* scroll_vert can scroll by pixels */ - parse_cmd_line("scroll_vert 15", NULL); + /* scroll vertical can scroll by pixels */ + parse_cmd_line("scroll vertical 15", NULL); g_assert_cmpfloat(gtk_adjustment_get_value(uzbl.gui.bar_v), ==, 15); - parse_cmd_line("scroll_vert -10", NULL); + parse_cmd_line("scroll vertical -10", NULL); g_assert_cmpfloat(gtk_adjustment_get_value(uzbl.gui.bar_v), ==, 5); - /* scroll_vert can scroll by a percentage of the page size */ - parse_cmd_line("scroll_vert 100%", NULL); + /* scroll vertical can scroll by a percentage of the page size */ + parse_cmd_line("scroll vertical 100%", NULL); g_assert_cmpfloat(gtk_adjustment_get_value(uzbl.gui.bar_v), ==, 10); - parse_cmd_line("scroll_vert -150%", NULL); - g_assert_cmpfloat(gtk_adjustment_get_value(uzbl.gui.bar_v), ==, 2.5); + parse_cmd_line("scroll vertical 150%", NULL); + g_assert_cmpfloat(gtk_adjustment_get_value(uzbl.gui.bar_v), ==, 17.5); /* scroll_horz behaves basically the same way. */ } -- cgit v1.2.3