aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-06 16:42:31 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-06 16:42:31 +0000
commit76d4eeb34e8b1cfbf41ddc4bcffebbfb0358bcb2 (patch)
treedf39dc1b21e2ae9b606781810a67dfb319e153f1
parentae019a01faae3b86808befadab158035d524936f (diff)
downloadimv-76d4eeb34e8b1cfbf41ddc4bcffebbfb0358bcb2.tar.gz
Let x = close current image
-rw-r--r--main.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/main.c b/main.c
index c914ad7..0f5947a 100644
--- a/main.c
+++ b/main.c
@@ -68,7 +68,7 @@ void add_path(const char* path)
void remove_current_path()
{
if(g_path.cur->next == g_path.cur) {
- fprintf(stderr, "All input paths removed. Exiting\n");
+ fprintf(stderr, "All input files closed. Exiting\n");
exit(0);
}
@@ -80,6 +80,7 @@ void remove_current_path()
} else {
g_path.cur = cur->next;
}
+ g_path.reload = 1;
free(cur);
}
@@ -161,18 +162,19 @@ int main(int argc, char** argv)
break;
case SDL_KEYDOWN:
switch (e.key.keysym.sym) {
- case SDLK_q: quit = 1; break;
- case SDLK_RIGHT: prev_path(); break;
- case SDLK_LEFT: next_path(); break;
+ case SDLK_q: quit = 1; break;
+ case SDLK_RIGHT: prev_path(); break;
+ case SDLK_LEFT: next_path(); break;
case SDLK_i:
- case SDLK_UP: zoom_view(1); break;
+ case SDLK_UP: zoom_view(1); break;
case SDLK_o:
- case SDLK_DOWN: zoom_view(-1); break;
- case SDLK_r: reset_view(); break;
- case SDLK_j: move_view(0, -50); break;
- case SDLK_k: move_view(0, 50); break;
- case SDLK_h: move_view(50, 0); break;
- case SDLK_l: move_view(-50, 0); break;
+ case SDLK_DOWN: zoom_view(-1); break;
+ case SDLK_r: reset_view(); break;
+ case SDLK_j: move_view(0, -50); break;
+ case SDLK_k: move_view(0, 50); break;
+ case SDLK_h: move_view(50, 0); break;
+ case SDLK_l: move_view(-50, 0); break;
+ case SDLK_x: remove_current_path(); break;
}
break;
case SDL_MOUSEWHEEL: