Renamed scroll() to pan_screen()
This commit is contained in:
parent
6b2a098289
commit
2b7192b1ac
8
config.h
8
config.h
|
@ -70,10 +70,10 @@ static const keymap_t keys[] = {
|
|||
{ XK_l, move, DIR_RIGHT },
|
||||
{ XK_Right, move, DIR_RIGHT },
|
||||
|
||||
{ XK_braceleft, scroll, DIR_LEFT },
|
||||
{ XK_Next, scroll, DIR_DOWN },
|
||||
{ XK_Prior, scroll, DIR_UP },
|
||||
{ XK_braceright, scroll, DIR_RIGHT },
|
||||
{ XK_braceleft, pan_screen, DIR_LEFT },
|
||||
{ XK_Next, pan_screen, DIR_DOWN },
|
||||
{ XK_Prior, pan_screen, DIR_UP },
|
||||
{ XK_braceright, pan_screen, DIR_RIGHT },
|
||||
|
||||
{ XK_H, pan_edge, DIR_LEFT },
|
||||
{ XK_J, pan_edge, DIR_DOWN },
|
||||
|
|
2
events.c
2
events.c
|
@ -483,7 +483,7 @@ int move(XEvent *e, arg_t 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)
|
||||
return img_pan(&img, &win, dir, 1);
|
||||
else
|
||||
|
|
2
events.h
2
events.h
|
@ -56,7 +56,7 @@ int first(XEvent*, arg_t);
|
|||
int last(XEvent*, arg_t);
|
||||
int remove_image(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 drag(XEvent*, arg_t);
|
||||
int rotate(XEvent*, arg_t);
|
||||
|
|
10
image.c
10
image.c
|
@ -277,19 +277,19 @@ int img_move(img_t *img, win_t *win, int dx, int dy) {
|
|||
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)
|
||||
return 0;
|
||||
|
||||
switch (dir) {
|
||||
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:
|
||||
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:
|
||||
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:
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue