Redraw the contents of the dialog. Definition at line 148 of file gui_vfslist.c. 00149 { 00150 unsigned int i, idx, idxw, idxmaxw = 0; 00151 char num[16], mark; 00152 struct vfsref *vr; 00153 00154 if (gv->win == NULL) 00155 return; 00156 00157 /* Make sure we have everything in sight */ 00158 gui_vfslist_cursor_adjust(gv); 00159 00160 gui_lock(); 00161 werase(gv->win); 00162 00163 vr = gv->vr_top; 00164 idx = gv->idx_top; 00165 if (gv->shownumbers) 00166 idxmaxw = gui_vfslist_idxcol_width(gv); 00167 for (i = 0; i < gv->winheight; i++) { 00168 if (vr == NULL) { 00169 /* We've reached the bottom of the list */ 00170 mvwaddch(gv->win, i, 0, ' '); 00171 wbkgdset(gv->win, COLOR_PAIR(GUI_COLOR_BLOCK)); 00172 wclrtobot(gv->win); 00173 break; 00174 } 00175 00176 /* Sanity check */ 00177 g_assert((vr == gv->vr_selected) == (idx == gv->idx_selected)); 00178 00179 if (vr == gv->vr_selected && gv->winfocused) 00180 /* Selected */ 00181 wbkgdset(gv->win, COLOR_PAIR(GUI_COLOR_SELECT)); 00182 else if (vfs_marked(vr)) 00183 /* Marked */ 00184 wbkgdset(gv->win, COLOR_PAIR(GUI_COLOR_MARKED)); 00185 else if (vr == gv->vr_selected) 00186 /* Selected, but inactive */ 00187 wbkgdset(gv->win, COLOR_PAIR(GUI_COLOR_DESELECT)); 00188 00189 /* Small whitespace on the left, or > when black & white */ 00190 if ((vr == gv->vr_selected) && !gui_draw_colors) { 00191 if (gv->winfocused) 00192 wattron(gv->win, A_BOLD); 00193 mvwaddch(gv->win, i, 0, '>'); 00194 } else { 00195 mvwaddch(gv->win, i, 0, ' '); 00196 } 00197 wclrtoeol(gv->win); 00198 00199 if (gv->shownumbers) { 00200 idxw = snprintf(num, sizeof num, "%d", idx); 00201 mvwaddstr(gv->win, i, 1 + idxmaxw - idxw, num); 00202 waddstr(gv->win, ". "); 00203 waddstr(gv->win, vfs_name(vr)); 00204 } else { 00205 waddstr(gv->win, vfs_name(vr)); 00206 } 00207 00208 /* Marking character for dirs and such */ 00209 mark = vfs_marking(vr); 00210 if (mark != '\0') 00211 waddch(gv->win, mark); 00212 00213 wbkgdset(gv->win, COLOR_PAIR(GUI_COLOR_BLOCK)); 00214 wattroff(gv->win, A_BOLD); 00215 00216 vr = vfs_list_next(vr); 00217 idx++; 00218 } 00219 00220 wnoutrefresh(gv->win); 00221 gui_unlock(); 00222 00223 gui_vfslist_percent(gv); 00224 00225 if (gv->callback != NULL) 00226 gv->callback(); 00227 }
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() |
1.6.3