From 87a1ace8a1cb83132f791cb19c3fa31b9b6e3f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Sat, 9 Jun 2018 13:12:46 +0200 Subject: (Un)mark single image through generic function --- main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index aa9775d..190ca29 100644 --- a/main.c +++ b/main.c @@ -321,6 +321,18 @@ void load_image(int new) reset_timeout(animate); } +bool mark_image(int n, bool on) +{ + if (!!(files[n].flags & FF_MARK) != on) { + files[n].flags ^= FF_MARK; + markcnt += on ? 1 : -1; + if (mode == MODE_THUMB) + tns_mark(&tns, n, on); + return true; + } + return false; +} + void bar_put(win_bar_t *bar, const char *fmt, ...) { size_t len = bar->size - (bar->p - bar->buf), n; -- cgit v1.2.3