Renamed scroll() to pan_screen()

This commit is contained in:
Bert 2011-08-05 10:17:36 +02:00
parent 6b2a098289
commit 2b7192b1ac
4 changed files with 11 additions and 11 deletions

View File

@ -70,10 +70,10 @@ static const keymap_t keys[] = {
{ XK_l, move, DIR_RIGHT }, { XK_l, move, DIR_RIGHT },
{ XK_Right, move, DIR_RIGHT }, { XK_Right, move, DIR_RIGHT },
{ XK_braceleft, scroll, DIR_LEFT }, { XK_braceleft, pan_screen, DIR_LEFT },
{ XK_Next, scroll, DIR_DOWN }, { XK_Next, pan_screen, DIR_DOWN },
{ XK_Prior, scroll, DIR_UP }, { XK_Prior, pan_screen, DIR_UP },
{ XK_braceright, scroll, DIR_RIGHT }, { XK_braceright, pan_screen, DIR_RIGHT },
{ XK_H, pan_edge, DIR_LEFT }, { XK_H, pan_edge, DIR_LEFT },
{ XK_J, pan_edge, DIR_DOWN }, { XK_J, pan_edge, DIR_DOWN },

View File

@ -483,7 +483,7 @@ int move(XEvent *e, arg_t dir) {
return tns_move_selection(&tns, &win, dir); return tns_move_selection(&tns, &win, dir);
} }
int scroll(XEvent *e, arg_t dir) { int pan_screen(XEvent *e, arg_t dir) {
if (mode == MODE_NORMAL) if (mode == MODE_NORMAL)
return img_pan(&img, &win, dir, 1); return img_pan(&img, &win, dir, 1);
else else

View File

@ -56,7 +56,7 @@ int first(XEvent*, arg_t);
int last(XEvent*, arg_t); int last(XEvent*, arg_t);
int remove_image(XEvent*, arg_t); int remove_image(XEvent*, arg_t);
int move(XEvent*, arg_t); int move(XEvent*, arg_t);
int scroll(XEvent*, arg_t); int pan_screen(XEvent*, arg_t);
int pan_edge(XEvent*, arg_t); int pan_edge(XEvent*, arg_t);
int drag(XEvent*, arg_t); int drag(XEvent*, arg_t);
int rotate(XEvent*, arg_t); int rotate(XEvent*, arg_t);

10
image.c
View File

@ -277,19 +277,19 @@ int img_move(img_t *img, win_t *win, int dx, int dy) {
return ox != img->x || oy != img->y; return ox != img->x || oy != img->y;
} }
int img_pan(img_t *img, win_t *win, direction_t dir, int page) { int img_pan(img_t *img, win_t *win, direction_t dir, int screen) {
if (!img || !img->im || !win) if (!img || !img->im || !win)
return 0; return 0;
switch (dir) { switch (dir) {
case DIR_LEFT: case DIR_LEFT:
return img_move(img, win, win->w / (page ? 1 : 5), 0); return img_move(img, win, win->w / (screen ? 1 : 5), 0);
case DIR_RIGHT: case DIR_RIGHT:
return img_move(img, win, win->w / (page ? 1 : 5) * -1, 0); return img_move(img, win, win->w / (screen ? 1 : 5) * -1, 0);
case DIR_UP: case DIR_UP:
return img_move(img, win, 0, win->h / (page ? 1 : 5)); return img_move(img, win, 0, win->h / (screen ? 1 : 5));
case DIR_DOWN: case DIR_DOWN:
return img_move(img, win, 0, win->h / (page ? 1 : 5) * -1); return img_move(img, win, 0, win->h / (screen ? 1 : 5) * -1);
} }
return 0; return 0;