nsxiv524d9de
Removed fit-win-to-img command
+5 −65
7 files changed
- M README.md +2 −3
- M commands.c +0 −20
- M commands.h +0 −1
- M config.def.h +0 −1
- M sxiv.1 +3 −6
- M window.c +0 −33
- M window.h +0 −1
| @@ -149,10 +149,9 @@ of small previews is displayed, making it easy to choose an image to open. | |||
| 149 | 149 | {,} Decrease/increase gamma | |
| 150 | 150 | Ctrl-g Reset gamma | |
| 151 | 151 | ||
| 152 | − | s Toggle slideshow or set delay to [count] seconds | |
| 153 | − | ||
| 154 | 152 | a Toggle anti-aliasing | |
| 155 | − | W Resize window to fit image | |
| 153 | + | ||
| 154 | + | s Toggle slideshow or set delay to [count] seconds | |
| 156 | 155 | ||
| 157 | 156 | ||
| 158 | 157 | **Mouse button mappings:** | |
| @@ -441,26 +441,6 @@ cmdreturn_t i_fit_to_win(arg_t a) | |||
| 441 | 441 | return CMD_INVALID; | |
| 442 | 442 | } | |
| 443 | 443 | ||
| 444 | − | cmdreturn_t i_fit_to_img(arg_t a) | |
| 445 | − | { | |
| 446 | − | int x, y; | |
| 447 | − | unsigned int w, h; | |
| 448 | − | cmdreturn_t ret = CMD_INVALID; | |
| 449 | − | ||
| 450 | − | if (mode == MODE_IMAGE) { | |
| 451 | − | x = MAX(0, win.x + img.x); | |
| 452 | − | y = MAX(0, win.y + img.y); | |
| 453 | − | w = img.w * img.zoom; | |
| 454 | − | h = img.h * img.zoom; | |
| 455 | − | if ((ret = win_moveresize(&win, x, y, w, h))) { | |
| 456 | − | img.x = x - win.x; | |
| 457 | − | img.y = y - win.y; | |
| 458 | − | img.dirty = true; | |
| 459 | − | } | |
| 460 | − | } | |
| 461 | − | return ret; | |
| 462 | − | } | |
| 463 | − | ||
| 464 | 444 | cmdreturn_t i_rotate(arg_t a) | |
| 465 | 445 | { | |
| 466 | 446 | degree_t degree = (degree_t) a; | |
| @@ -70,7 +70,6 @@ cmdreturn_t i_drag(arg_t); | |||
| 70 | 70 | cmdreturn_t i_zoom(arg_t); | |
| 71 | 71 | cmdreturn_t i_set_zoom(arg_t); | |
| 72 | 72 | cmdreturn_t i_fit_to_win(arg_t); | |
| 73 | − | cmdreturn_t i_fit_to_img(arg_t); | |
| 74 | 73 | cmdreturn_t i_rotate(arg_t); | |
| 75 | 74 | cmdreturn_t i_flip(arg_t); | |
| 76 | 75 | cmdreturn_t i_slideshow(arg_t); | |
| @@ -141,7 +141,6 @@ static const keymap_t keys[] = { | |||
| 141 | 141 | { 0, XK_w, i_fit_to_win, (arg_t) SCALE_FIT }, | |
| 142 | 142 | { 0, XK_e, i_fit_to_win, (arg_t) SCALE_WIDTH }, | |
| 143 | 143 | { 0, XK_E, i_fit_to_win, (arg_t) SCALE_HEIGHT }, | |
| 144 | − | { 0, XK_W, i_fit_to_img, (arg_t) None }, | |
| 145 | 144 | ||
| 146 | 145 | { 0, XK_less, i_rotate, (arg_t) DEGREE_270 }, | |
| 147 | 146 | { 0, XK_greater, i_rotate, (arg_t) DEGREE_90 }, | |
| @@ -310,16 +310,13 @@ Increase gamma. | |||
| 310 | 310 | Reset gamma. | |
| 311 | 311 | .SS Miscellaneous | |
| 312 | 312 | .TP | |
| 313 | + | .B a | |
| 314 | + | Toggle anti-aliasing. | |
| 315 | + | .TP | |
| 313 | 316 | .B s | |
| 314 | 317 | Toggle slideshow mode and/or set the delay between images to | |
| 315 | 318 | .I count | |
| 316 | 319 | seconds. | |
| 317 | − | .TP | |
| 318 | − | .B a | |
| 319 | − | Toggle anti-aliasing. | |
| 320 | − | .TP | |
| 321 | − | .B W | |
| 322 | − | Resize window to fit image. | |
| 323 | 320 | .SH MOUSE COMMANDS | |
| 324 | 321 | The following mouse mappings are available in image mode: | |
| 325 | 322 | .SS Navigate image list | |
| @@ -374,39 +374,6 @@ void win_expose(win_t *win, XExposeEvent *e) | |||
| 374 | 374 | e->x, e->y, e->width, e->height, e->x, e->y); | |
| 375 | 375 | } | |
| 376 | 376 | ||
| 377 | − | bool win_moveresize(win_t *win, int x, int y, unsigned int w, unsigned int h) | |
| 378 | − | { | |
| 379 | − | if (win == NULL || win->xwin == None) | |
| 380 | − | return false; | |
| 381 | − | ||
| 382 | − | /* caller knows nothing about the bar */ | |
| 383 | − | h += win->bar.h; | |
| 384 | − | ||
| 385 | − | x = MAX(0, x); | |
| 386 | − | y = MAX(0, y); | |
| 387 | − | w = MIN(w, win->env.scrw - 2 * win->bw); | |
| 388 | − | h = MIN(h, win->env.scrh - 2 * win->bw); | |
| 389 | − | ||
| 390 | − | if (win->x == x && win->y == y && win->w == w && win->h + win->bar.h == h) | |
| 391 | − | return false; | |
| 392 | − | ||
| 393 | − | win->x = x; | |
| 394 | − | win->y = y; | |
| 395 | − | win->w = w; | |
| 396 | − | win->h = h - win->bar.h; | |
| 397 | − | ||
| 398 | − | win_update_sizehints(win); | |
| 399 | − | ||
| 400 | − | XMoveResizeWindow(win->env.dpy, win->xwin, x, y, w, h); | |
| 401 | − | ||
| 402 | − | if (win->pm != None) { | |
| 403 | − | XFreePixmap(win->env.dpy, win->pm); | |
| 404 | − | win->pm = None; | |
| 405 | − | } | |
| 406 | − | ||
| 407 | − | return true; | |
| 408 | − | } | |
| 409 | − | ||
| 410 | 377 | void win_toggle_fullscreen(win_t *win) | |
| 411 | 378 | { | |
| 412 | 379 | XEvent ev; | |
| @@ -86,7 +86,6 @@ void win_close(win_t*); | |||
| 86 | 86 | ||
| 87 | 87 | bool win_configure(win_t*, XConfigureEvent*); | |
| 88 | 88 | void win_expose(win_t*, XExposeEvent*); | |
| 89 | − | bool win_moveresize(win_t*, int, int, unsigned int, unsigned int); | |
| 90 | 89 | ||
| 91 | 90 | void win_toggle_fullscreen(win_t*); | |
| 92 | 91 | void win_toggle_bar(win_t*); | |