From 760eed07885a28bd82351d64f24d1f325373dbaf Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Wed, 7 Aug 2019 20:13:30 +0100 Subject: Add background colour command --- src/imv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/imv.c') diff --git a/src/imv.c b/src/imv.c index d9d54c0..c1f5a3b 100644 --- a/src/imv.c +++ b/src/imv.c @@ -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, "", "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]; -- cgit v1.2.3