diff options
author | Bert <ber.t@gmx.com> | 2011-02-19 22:12:08 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-02-19 22:12:08 +0100 |
commit | a152f82ce6e010859232f83f466a4c1628bb18ed (patch) | |
tree | 938dc3ab7960900648a0768e7929a1eb5e3ebc0c /main.c | |
parent | 2194df82ed76870829ef948cd2d53abbe8126457 (diff) |
Sync thumb selection & fileidx; check thumb view
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -156,8 +156,8 @@ void update_title() { if (mode == MODE_THUMBS) { n = snprintf(win_title, TITLE_LEN, "sxiv: [%d/%d] %s", - tns.cnt ? tns.sel + 1 : 0, tns.cnt, - tns.cnt ? filenames[tns.sel] : ""); + tns.cnt ? fileidx + 1 : 0, tns.cnt, + tns.cnt ? filenames[fileidx] : ""); } else { if (img.valid) { size = filesize; @@ -272,7 +272,7 @@ void on_keypress(XKeyEvent *kev) { unsigned int w, h; char key; KeySym ksym; - int changed, sel; + int changed; if (!kev) return; @@ -381,10 +381,6 @@ void on_keypress(XKeyEvent *kev) { /* switch to thumnail mode */ case XK_Return: if (options->thumbnails) { - if (fileidx < tns.cnt) - tns.sel = fileidx; - else - tns.sel = 0; mode = MODE_THUMBS; changed = tns.dirty = 1; } @@ -401,12 +397,9 @@ void on_keypress(XKeyEvent *kev) { } } else { /* thumbnail mode */ - sel = tns.sel; - switch (ksym) { /* open selected image */ case XK_Return: - fileidx = sel; load_image(); mode = MODE_NORMAL; win_set_cursor(&win, CURSOR_ARROW); |