Krolyxon
Commit 524d9de

Branches

Refs →

nsxiv524d9de

Removed fit-win-to-img command

Author
Bert Münnich
Date
2014-02-04 22:38 +0100
Parent
eb82519
Commit
524d9de877dcf0dc4212c12c3bd09db285dae17e

+5 −65

7 files changed

  1. M README.md +2 −3
  2. M commands.c +0 −20
  3. M commands.h +0 −1
  4. M config.def.h +0 −1
  5. M sxiv.1 +3 −6
  6. M window.c +0 −33
  7. M window.h +0 −1
M README.md View
@@ -149,10 +149,9 @@ of small previews is displayed, making it easy to choose an image to open.
149149 {,} Decrease/increase gamma
150150 Ctrl-g Reset gamma
151151
152− s Toggle slideshow or set delay to [count] seconds
153−
154152 a Toggle anti-aliasing
155− W Resize window to fit image
153+
154+ s Toggle slideshow or set delay to [count] seconds
156155
157156
158157 **Mouse button mappings:**
M commands.c View
@@ -441,26 +441,6 @@ cmdreturn_t i_fit_to_win(arg_t a)
441441 return CMD_INVALID;
442442 }
443443
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−
464444 cmdreturn_t i_rotate(arg_t a)
465445 {
466446 degree_t degree = (degree_t) a;
M commands.h View
@@ -70,7 +70,6 @@ cmdreturn_t i_drag(arg_t);
7070 cmdreturn_t i_zoom(arg_t);
7171 cmdreturn_t i_set_zoom(arg_t);
7272 cmdreturn_t i_fit_to_win(arg_t);
73−cmdreturn_t i_fit_to_img(arg_t);
7473 cmdreturn_t i_rotate(arg_t);
7574 cmdreturn_t i_flip(arg_t);
7675 cmdreturn_t i_slideshow(arg_t);
M config.def.h View
@@ -141,7 +141,6 @@ static const keymap_t keys[] = {
141141 { 0, XK_w, i_fit_to_win, (arg_t) SCALE_FIT },
142142 { 0, XK_e, i_fit_to_win, (arg_t) SCALE_WIDTH },
143143 { 0, XK_E, i_fit_to_win, (arg_t) SCALE_HEIGHT },
144− { 0, XK_W, i_fit_to_img, (arg_t) None },
145144
146145 { 0, XK_less, i_rotate, (arg_t) DEGREE_270 },
147146 { 0, XK_greater, i_rotate, (arg_t) DEGREE_90 },
M sxiv.1 View
@@ -310,16 +310,13 @@ Increase gamma.
310310 Reset gamma.
311311 .SS Miscellaneous
312312 .TP
313+.B a
314+Toggle anti-aliasing.
315+.TP
313316 .B s
314317 Toggle slideshow mode and/or set the delay between images to
315318 .I count
316319 seconds.
317−.TP
318−.B a
319−Toggle anti-aliasing.
320−.TP
321−.B W
322−Resize window to fit image.
323320 .SH MOUSE COMMANDS
324321 The following mouse mappings are available in image mode:
325322 .SS Navigate image list
M window.c View
@@ -374,39 +374,6 @@ void win_expose(win_t *win, XExposeEvent *e)
374374 e->x, e->y, e->width, e->height, e->x, e->y);
375375 }
376376
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−
410377 void win_toggle_fullscreen(win_t *win)
411378 {
412379 XEvent ev;
M window.h View
@@ -86,7 +86,6 @@ void win_close(win_t*);
8686
8787 bool win_configure(win_t*, XConfigureEvent*);
8888 void win_expose(win_t*, XExposeEvent*);
89−bool win_moveresize(win_t*, int, int, unsigned int, unsigned int);
9089
9190 void win_toggle_fullscreen(win_t*);
9291 void win_toggle_bar(win_t*);