Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Show info message in bar while loading thumbnails

  • Loading branch information...
commit a329615c684c68700134aaed6b5e172ff9924130 1 parent d407dd6
Bert Münnich authored

Showing 1 changed file with 12 additions and 9 deletions. Show diff stats Hide diff stats

  1. +12 9 main.c
21 main.c
@@ -231,11 +231,15 @@ void update_info(void) {
231 231 pw++;
232 232
233 233 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);
239 243 } else {
240 244 size_readable(&size, &size_unit);
241 245 if (img.multi.cnt > 0) {
@@ -252,11 +256,10 @@ void update_info(void) {
252 256 snprintf(win_bar_r, sizeof win_bar_r, "%.2f%s%s%dx%d%s%3d%%%s",
253 257 size, size_unit, BAR_SEPARATOR, img.w, img.h, BAR_SEPARATOR,
254 258 (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);
257 262 }
258   - win_set_title(&win, win_title);
259   - win_set_bar_info(&win, win_bar_l, win_bar_r);
260 263 }
261 264
262 265 void redraw(void) {

0 comments on commit a329615

Please sign in to comment.
Something went wrong with that request. Please try again.