Krolyxon
Commit a329615

Branches

Refs →

nsxiva329615

Show info message in bar while loading thumbnails

Author
Bert Münnich
Date
2012-02-15 19:29 +0100
Parent
d407dd6
Commit
a329615c684c68700134aaed6b5e172ff9924130

+12 −9

1 file changed

  1. M main.c +12 −9
M main.c View
@@ -231,11 +231,15 @@ void update_info(void) {
231231 pw++;
232232
233233 if (mode == MODE_THUMB) {
234− snprintf(win_bar_l, sizeof win_bar_l, "%0*d/%d%s%s",
235− pw, tns.cnt > 0 ? tns.sel + 1 : 0, filecnt, BAR_SEPARATOR,
236− tns.cnt > 0 ? files[tns.sel].base : "");
237− win_bar_r[0] = '\0';
238− snprintf(win_title, sizeof win_title, "sxiv");
234+ if (tns.cnt != filecnt) {
235+ snprintf(win_bar_l, sizeof win_bar_l, "Loading... %0*d/%d",
236+ pw, tns.cnt, filecnt);
237+ } else {
238+ snprintf(win_bar_l, sizeof win_bar_l, "%0*d/%d%s%s",
239+ pw, tns.sel + 1, filecnt, BAR_SEPARATOR, files[tns.sel].base);
240+ }
241+ win_set_title(&win, "sxiv");
242+ win_set_bar_info(&win, win_bar_l, NULL);
239243 } else {
240244 size_readable(&size, &size_unit);
241245 if (img.multi.cnt > 0) {
@@ -252,11 +256,10 @@ void update_info(void) {
252256 snprintf(win_bar_r, sizeof win_bar_r, "%.2f%s%s%dx%d%s%3d%%%s",
253257 size, size_unit, BAR_SEPARATOR, img.w, img.h, BAR_SEPARATOR,
254258 (int) (img.zoom * 100.0), frame_info);
255− snprintf(win_title, sizeof win_title, "sxiv - %s",
256− files[fileidx].name);
259+ snprintf(win_title, sizeof win_title, "sxiv - %s", files[fileidx].name);
260+ win_set_title(&win, win_title);
261+ win_set_bar_info(&win, win_bar_l, win_bar_r);
257262 }
258− win_set_title(&win, win_title);
259− win_set_bar_info(&win, win_bar_l, win_bar_r);
260263 }
261264
262265 void redraw(void) {