From 524d9de877dcf0dc4212c12c3bd09db285dae17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Tue, 4 Feb 2014 22:38:24 +0100 Subject: [PATCH] Removed fit-win-to-img command --- README.md | 5 ++--- commands.c | 20 -------------------- commands.h | 1 - config.def.h | 1 - sxiv.1 | 9 +++------ window.c | 33 --------------------------------- window.h | 1 - 7 files changed, 5 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 8939411..4cfc368 100644 --- a/README.md +++ b/README.md @@ -149,10 +149,9 @@ of small previews is displayed, making it easy to choose an image to open. {,} Decrease/increase gamma Ctrl-g Reset gamma - s Toggle slideshow or set delay to [count] seconds - a Toggle anti-aliasing - W Resize window to fit image + + s Toggle slideshow or set delay to [count] seconds **Mouse button mappings:** diff --git a/commands.c b/commands.c index 8234f08..1d1c8b3 100644 --- a/commands.c +++ b/commands.c @@ -441,26 +441,6 @@ cmdreturn_t i_fit_to_win(arg_t a) return CMD_INVALID; } -cmdreturn_t i_fit_to_img(arg_t a) -{ - int x, y; - unsigned int w, h; - cmdreturn_t ret = CMD_INVALID; - - if (mode == MODE_IMAGE) { - x = MAX(0, win.x + img.x); - y = MAX(0, win.y + img.y); - w = img.w * img.zoom; - h = img.h * img.zoom; - if ((ret = win_moveresize(&win, x, y, w, h))) { - img.x = x - win.x; - img.y = y - win.y; - img.dirty = true; - } - } - return ret; -} - cmdreturn_t i_rotate(arg_t a) { degree_t degree = (degree_t) a; diff --git a/commands.h b/commands.h index aebd253..dcc2e0f 100644 --- a/commands.h +++ b/commands.h @@ -70,7 +70,6 @@ cmdreturn_t i_drag(arg_t); cmdreturn_t i_zoom(arg_t); cmdreturn_t i_set_zoom(arg_t); cmdreturn_t i_fit_to_win(arg_t); -cmdreturn_t i_fit_to_img(arg_t); cmdreturn_t i_rotate(arg_t); cmdreturn_t i_flip(arg_t); cmdreturn_t i_slideshow(arg_t); diff --git a/config.def.h b/config.def.h index 8c2c7ed..8b835db 100644 --- a/config.def.h +++ b/config.def.h @@ -141,7 +141,6 @@ static const keymap_t keys[] = { { 0, XK_w, i_fit_to_win, (arg_t) SCALE_FIT }, { 0, XK_e, i_fit_to_win, (arg_t) SCALE_WIDTH }, { 0, XK_E, i_fit_to_win, (arg_t) SCALE_HEIGHT }, - { 0, XK_W, i_fit_to_img, (arg_t) None }, { 0, XK_less, i_rotate, (arg_t) DEGREE_270 }, { 0, XK_greater, i_rotate, (arg_t) DEGREE_90 }, diff --git a/sxiv.1 b/sxiv.1 index 983e338..7999efd 100644 --- a/sxiv.1 +++ b/sxiv.1 @@ -310,16 +310,13 @@ Increase gamma. Reset gamma. .SS Miscellaneous .TP +.B a +Toggle anti-aliasing. +.TP .B s Toggle slideshow mode and/or set the delay between images to .I count seconds. -.TP -.B a -Toggle anti-aliasing. -.TP -.B W -Resize window to fit image. .SH MOUSE COMMANDS The following mouse mappings are available in image mode: .SS Navigate image list diff --git a/window.c b/window.c index 8086a4c..b8d5cf5 100644 --- a/window.c +++ b/window.c @@ -374,39 +374,6 @@ void win_expose(win_t *win, XExposeEvent *e) e->x, e->y, e->width, e->height, e->x, e->y); } -bool win_moveresize(win_t *win, int x, int y, unsigned int w, unsigned int h) -{ - if (win == NULL || win->xwin == None) - return false; - - /* caller knows nothing about the bar */ - h += win->bar.h; - - x = MAX(0, x); - y = MAX(0, y); - w = MIN(w, win->env.scrw - 2 * win->bw); - h = MIN(h, win->env.scrh - 2 * win->bw); - - if (win->x == x && win->y == y && win->w == w && win->h + win->bar.h == h) - return false; - - win->x = x; - win->y = y; - win->w = w; - win->h = h - win->bar.h; - - win_update_sizehints(win); - - XMoveResizeWindow(win->env.dpy, win->xwin, x, y, w, h); - - if (win->pm != None) { - XFreePixmap(win->env.dpy, win->pm); - win->pm = None; - } - - return true; -} - void win_toggle_fullscreen(win_t *win) { XEvent ev; diff --git a/window.h b/window.h index ec71319..8324125 100644 --- a/window.h +++ b/window.h @@ -86,7 +86,6 @@ void win_close(win_t*); bool win_configure(win_t*, XConfigureEvent*); void win_expose(win_t*, XExposeEvent*); -bool win_moveresize(win_t*, int, int, unsigned int, unsigned int); void win_toggle_fullscreen(win_t*); void win_toggle_bar(win_t*);