aboutsummaryrefslogtreecommitdiff
path: root/src/imv.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-07 20:13:30 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-07 20:13:30 +0100
commit760eed07885a28bd82351d64f24d1f325373dbaf (patch)
treef4399427b69ea50e3f44e3c375c78eca5f25e735 /src/imv.c
parentda040a9e34767ef09f9226633503640d29648937 (diff)
downloadimv-760eed07885a28bd82351d64f24d1f325373dbaf.tar.gz
Add background colour command
Diffstat (limited to 'src/imv.c')
-rw-r--r--src/imv.c12
1 files changed, 12 insertions, 0 deletions
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, "<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];