aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-11-08 16:11:39 +0100
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-11-08 16:11:39 +0100
commit9dbcd20a5c3c788e4e9fcaefa01fc7cbaafd7c68 (patch)
treee7dfada7eb7ec8bbca3d1f88f521128fdd8e5a0c
parentb46e181523da5cd752222889a5a0bf880713856e (diff)
scroll stuff: update unit tests + remove bindings that (may) conflict with keycmd or are not needed + better default behavior for pageup and pagedown
-rw-r--r--examples/config/uzbl/config10
-rw-r--r--tests/test-command.c22
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 <Down> = scroll vertical 20
-@bind <Page_Down> = scroll vertical 500
+@bind <Page_Down> = scroll vertical 100%
@bind k = scroll vertical -20
-@bind <Up> = scroll vertical -20
-@bind <Page_Up> = scroll vertical -500
+@bind <Page_Up> = scroll vertical -100%
@bind h = scroll horizontal -20
-@bind <Left> = scroll horizontal -20
@bind l = scroll horizontal 20
-@bind <Right> = scroll horizontal 20
@bind << = scroll vertical begin
-@bind <Home> = scroll vertical begin
@bind >> = scroll vertical end
-@bind <End> = 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. */
}