From b8ff1677b1cbb4d3e769861d1e14234c6a38a80a Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 26 Jul 2011 18:01:29 +0200 Subject: Major code refactoring - Configurable key and mouse mappings in config.h - Put event handling code from main.c into events.[ch] --- thumbs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'thumbs.c') diff --git a/thumbs.c b/thumbs.c index dd1dba6..5700b87 100644 --- a/thumbs.c +++ b/thumbs.c @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define _THUMBS_CONFIG + #include #include #include @@ -205,7 +207,7 @@ void tns_free(tns_t *tns) { return; if (tns->thumbs) { - for (i = 0; i < tns->cnt; ++i) { + for (i = 0; i < tns->cnt; i++) { if (tns->thumbs[i].im) { imlib_context_set_image(tns->thumbs[i].im); imlib_free_image(); @@ -337,7 +339,7 @@ void tns_render(tns_t *tns, win_t *win) { tns->x = x = (win->w - MIN(cnt, tns->cols) * thumb_dim) / 2 + 5; tns->y = y = (win->h - (cnt / tns->cols + r) * thumb_dim) / 2 + 5; - for (i = 0; i < cnt; ++i) { + for (i = 0; i < cnt; i++) { t = &tns->thumbs[tns->first + i]; t->x = x + (THUMB_SIZE - t->w) / 2; t->y = y + (THUMB_SIZE - t->h) / 2; @@ -391,11 +393,11 @@ int tns_move_selection(tns_t *tns, win_t *win, direction_t dir) { switch (dir) { case DIR_LEFT: if (tns->sel > 0) - --tns->sel; + tns->sel--; break; case DIR_RIGHT: if (tns->sel < tns->cnt - 1) - ++tns->sel; + tns->sel++; break; case DIR_UP: if (tns->sel >= tns->cols) -- cgit v1.2.3-54-g00ecf