From a345c963f894626269c6f3581d1db982770bac7d Mon Sep 17 00:00:00 2001 From: Bert Date: Sat, 19 Feb 2011 23:07:10 +0100 Subject: Double click thumb to open --- main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index c1f2b72..2614812 100644 --- a/main.c +++ b/main.c @@ -501,10 +501,15 @@ void on_buttonpress(XButtonEvent *bev) { switch (bev->button) { case Button1: if ((sel = tns_translate(&tns, bev->x, bev->y)) >= 0) { - fileidx = sel; - load_image(); - mode = MODE_NORMAL; - win_set_cursor(&win, CURSOR_ARROW); + if (sel == fileidx) { + load_image(); + mode = MODE_NORMAL; + win_set_cursor(&win, CURSOR_ARROW); + } else { + tns_highlight(&tns, &win, fileidx, False); + tns_highlight(&tns, &win, sel, True); + fileidx = sel; + } changed = 1; break; } -- cgit v1.2.3