summaryrefslogtreecommitdiffstats
path: root/thumbs.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-07-26 18:01:29 +0200
committerBert <ber.t@gmx.com>2011-07-26 18:01:29 +0200
commitb8ff1677b1cbb4d3e769861d1e14234c6a38a80a (patch)
tree32da4629b8874fbe17deab774f78314b56607302 /thumbs.c
parenta271e167443aedca2ed9c28b51fc6de33692dadb (diff)
downloadnsxiv-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.c10
1 files changed, 6 insertions, 4 deletions
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 <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)