Show info message in bar while loading thumbnails
This commit is contained in:
		
							parent
							
								
									d407dd65d5
								
							
						
					
					
						commit
						a329615c68
					
				
							
								
								
									
										21
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								main.c
									
									
									
									
									
								
							| @ -231,11 +231,15 @@ void update_info(void) { | |||||||
| 		pw++; | 		pw++; | ||||||
| 
 | 
 | ||||||
| 	if (mode == MODE_THUMB) { | 	if (mode == MODE_THUMB) { | ||||||
| 		snprintf(win_bar_l, sizeof win_bar_l, "%0*d/%d%s%s", | 		if (tns.cnt != filecnt) { | ||||||
| 		         pw, tns.cnt > 0 ? tns.sel + 1 : 0, filecnt, BAR_SEPARATOR, | 			snprintf(win_bar_l, sizeof win_bar_l, "Loading... %0*d/%d", | ||||||
| 		         tns.cnt > 0 ? files[tns.sel].base : ""); | 			         pw, tns.cnt, filecnt); | ||||||
| 		win_bar_r[0] = '\0'; | 		} else { | ||||||
| 		snprintf(win_title, sizeof win_title, "sxiv"); | 			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 { | 	} else { | ||||||
| 		size_readable(&size, &size_unit); | 		size_readable(&size, &size_unit); | ||||||
| 		if (img.multi.cnt > 0) { | 		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", | 		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, | 		         size, size_unit, BAR_SEPARATOR, img.w, img.h, BAR_SEPARATOR, | ||||||
| 		         (int) (img.zoom * 100.0), frame_info); | 		         (int) (img.zoom * 100.0), frame_info); | ||||||
| 		snprintf(win_title, sizeof win_title, "sxiv - %s", | 		snprintf(win_title, sizeof win_title, "sxiv - %s", files[fileidx].name); | ||||||
| 		         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) { | void redraw(void) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Bert Münnich
						Bert Münnich