diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2019-08-07 20:13:30 +0100 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-08-07 20:13:30 +0100 |
commit | 760eed07885a28bd82351d64f24d1f325373dbaf (patch) | |
tree | f4399427b69ea50e3f44e3c375c78eca5f25e735 | |
parent | da040a9e34767ef09f9226633503640d29648937 (diff) | |
download | imv-760eed07885a28bd82351d64f24d1f325373dbaf.tar.gz |
Add background colour command
-rw-r--r-- | src/imv.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -189,6 +189,7 @@ static void command_next_frame(struct list *args, const char *argstr, void *data static void command_toggle_playing(struct list *args, const char *argstr, void *data); static void command_set_scaling_mode(struct list *args, const char *argstr, void *data); static void command_set_slideshow_duration(struct list *args, const char *argstr, void *data); +static void command_set_background(struct list *args, const char *argstr, void *data); static bool setup_window(struct imv *imv); static void consume_internal_event(struct imv *imv, struct internal_event *event); @@ -531,6 +532,8 @@ struct imv *imv_create(void) imv_command_register(imv->commands, "toggle_playing", &command_toggle_playing); imv_command_register(imv->commands, "scaling", &command_set_scaling_mode); imv_command_register(imv->commands, "slideshow", &command_set_slideshow_duration); + imv_command_register(imv->commands, "background", &command_set_background); + imv_command_register(imv->commands, "bg", &command_set_background); add_bind(imv, "q", "quit"); add_bind(imv, "<Left>", "prev"); @@ -1611,6 +1614,15 @@ static void command_set_slideshow_duration(struct list *args, const char *argstr } } +static void command_set_background(struct list *args, const char *argstr, void *data) +{ + (void)argstr; + struct imv *imv = data; + if (args->len == 2) { + parse_bg(imv, args->items[1]); + } +} + static void update_env_vars(struct imv *imv) { char str[64]; |