diff options
author | Bert <ber.t@gmx.com> | 2011-07-26 18:01:29 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-07-26 18:01:29 +0200 |
commit | b8ff1677b1cbb4d3e769861d1e14234c6a38a80a (patch) | |
tree | 32da4629b8874fbe17deab774f78314b56607302 /thumbs.c | |
parent | a271e167443aedca2ed9c28b51fc6de33692dadb (diff) | |
download | nsxiv-b8ff1677b1cbb4d3e769861d1e14234c6a38a80a.tar.zst |
Major code refactoring
- Configurable key and mouse mappings in config.h
- Put event handling code from main.c into events.[ch]
Diffstat (limited to 'thumbs.c')
-rw-r--r-- | thumbs.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define _THUMBS_CONFIG + #include <stdlib.h> #include <string.h> #include <sys/time.h> @@ -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) |