diff options
author | Marco Peereboom <marco@conformal.com> | 2010-02-12 04:19:01 +0000 |
---|---|---|
committer | Marco Peereboom <marco@conformal.com> | 2010-02-12 04:19:01 +0000 |
commit | 5dc459a53bf8f8b39261e92887aef94559f1cf52 (patch) | |
tree | 4ad1023ff292c9a73e8ed350d892f43f02f69d4c | |
parent | 745bba72bc432cc5985e4c211be42b96830574ad (diff) | |
download | xombrero-5dc459a53bf8f8b39261e92887aef94559f1cf52.tar.gz |
use proper increments for movement.
-rw-r--r-- | xxxterm.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/xxxterm.c b/xxxterm.c index b33b0fd..03ba1d2 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -128,11 +128,7 @@ int move(struct tab *t, struct karg *args) { GtkAdjustment *adjust; - double pos; - double ps; - double upper; - double lower; - double max; + double pi, si, pos, ps, upper, lower, max; switch (args->i) { case XT_MOVE_DOWN: @@ -152,21 +148,24 @@ move(struct tab *t, struct karg *args) ps = gtk_adjustment_get_page_size(adjust); upper = gtk_adjustment_get_upper(adjust); lower = gtk_adjustment_get_lower(adjust); + si = gtk_adjustment_get_step_increment(adjust); + pi = gtk_adjustment_get_page_increment(adjust); max = upper - ps; - DNPRINTF(XT_D_MOVE, "move opcode %d %s pos %f ps %f upper %f lower %f max %f\n", + DNPRINTF(XT_D_MOVE, "move opcode %d %s pos %f ps %f upper %f lower %f " + "max %f si %f pi %f\n", args->i, adjust == t->adjust_h ? "horizontal" : "vertical", - pos, ps, upper, lower, max); + pos, ps, upper, lower, max, si, pi); switch (args->i) { case XT_MOVE_DOWN: case XT_MOVE_RIGHT: - pos += 24; + pos += si; gtk_adjustment_set_value(adjust, MIN(pos, max)); break; case XT_MOVE_UP: case XT_MOVE_LEFT: - pos -= 24; + pos -= si; gtk_adjustment_set_value(adjust, MAX(pos, lower)); break; case XT_MOVE_BOTTOM: @@ -178,11 +177,11 @@ move(struct tab *t, struct karg *args) gtk_adjustment_set_value(adjust, lower); break; case XT_MOVE_PAGEDOWN: - pos += ps; + pos += pi; gtk_adjustment_set_value(adjust, MIN(pos, max)); break; case XT_MOVE_PAGEUP: - pos -= ps; + pos -= pi; gtk_adjustment_set_value(adjust, MAX(pos, lower)); break; default: |