summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@gmx.com>2012-02-15 19:29:56 +0100
committerBert Münnich <ber.t@gmx.com>2012-02-15 19:29:56 +0100
commita329615c684c68700134aaed6b5e172ff9924130 (patch)
tree0216eb8d7ec6d7193c3bdf9f9898ae53335d2916 /main.c
parentd407dd65d58819210defd4d96eb8d4fb878c96ef (diff)
downloadnsxiv-a329615c684c68700134aaed6b5e172ff9924130.tar.zst
Show info message in bar while loading thumbnails
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/main.c b/main.c
index 19212ad..193dbbe 100644
--- a/main.c
+++ b/main.c
@@ -231,11 +231,15 @@ void update_info(void) {
pw++;
if (mode == MODE_THUMB) {
- snprintf(win_bar_l, sizeof win_bar_l, "%0*d/%d%s%s",
- pw, tns.cnt > 0 ? tns.sel + 1 : 0, filecnt, BAR_SEPARATOR,
- tns.cnt > 0 ? files[tns.sel].base : "");
- win_bar_r[0] = '\0';
- snprintf(win_title, sizeof win_title, "sxiv");
+ if (tns.cnt != filecnt) {
+ snprintf(win_bar_l, sizeof win_bar_l, "Loading... %0*d/%d",
+ pw, tns.cnt, filecnt);
+ } else {
+ snprintf(win_bar_l, sizeof win_bar_l, "%0*d/%d%s%s",
+ pw, tns.sel + 1, filecnt, BAR_SEPARATOR, files[tns.sel].base);
+ }
+ win_set_title(&win, "sxiv");
+ win_set_bar_info(&win, win_bar_l, NULL);
} else {
size_readable(&size, &size_unit);
if (img.multi.cnt > 0) {
@@ -252,11 +256,10 @@ void update_info(void) {
snprintf(win_bar_r, sizeof win_bar_r, "%.2f%s%s%dx%d%s%3d%%%s",
size, size_unit, BAR_SEPARATOR, img.w, img.h, BAR_SEPARATOR,
(int) (img.zoom * 100.0), frame_info);
- snprintf(win_title, sizeof win_title, "sxiv - %s",
- files[fileidx].name);
+ snprintf(win_title, sizeof win_title, "sxiv - %s", files[fileidx].name);
+ win_set_title(&win, win_title);
+ win_set_bar_info(&win, win_bar_l, win_bar_r);
}
- win_set_title(&win, win_title);
- win_set_bar_info(&win, win_bar_l, win_bar_r);
}
void redraw(void) {