rendering improvements
This commit is contained in:
+29
-16
@@ -120,7 +120,8 @@ void *thread_mid(){
|
||||
} else {
|
||||
print_dir(win_m, 1, &mid_dir);
|
||||
}
|
||||
wnoutrefresh(win_m);
|
||||
/*wnoutrefresh(win_m);*/
|
||||
wrefresh(win_m);
|
||||
pthread_mutex_unlock(&mutex_render);
|
||||
|
||||
|
||||
@@ -182,7 +183,8 @@ void *thread_lft(){
|
||||
pthread_mutex_lock(&mutex_render);
|
||||
werase(win_l);
|
||||
print_dir(win_l, 0, &lft_dir);
|
||||
wnoutrefresh(win_l);
|
||||
/*wnoutrefresh(win_l);*/
|
||||
wrefresh(win_l);
|
||||
pthread_mutex_unlock(&mutex_render);
|
||||
|
||||
pthread_mutex_unlock(&mutex_lft);
|
||||
@@ -244,7 +246,8 @@ void *thread_rgt(){
|
||||
pthread_mutex_lock(&mutex_render);
|
||||
werase(win_r);
|
||||
print_dir(win_r, 0, &rgt_dir);
|
||||
wnoutrefresh(win_r);
|
||||
/*wnoutrefresh(win_r);*/
|
||||
wrefresh(win_r);
|
||||
pthread_mutex_unlock(&mutex_render);
|
||||
|
||||
} else if ((status & STATUS_DELTA_TIME) != STATUS_DELTA_TIME && rgt_dir.file_count > 0) {
|
||||
@@ -259,7 +262,8 @@ void *thread_rgt(){
|
||||
} else if ((rgt_dir.current_file->permissions & S_IRUSR) == 0) {
|
||||
mvwaddstr(win_r, 0, 0, "not accessible");
|
||||
}
|
||||
wnoutrefresh(win_r);
|
||||
/*wnoutrefresh(win_r);*/
|
||||
wrefresh(win_r);
|
||||
pthread_mutex_unlock(&mutex_render);
|
||||
}
|
||||
}
|
||||
@@ -318,7 +322,8 @@ void *thread_top(){
|
||||
mvwaddnstr(win_t, 0, 0, top_buffer, strlen(global_path)+1);
|
||||
wattroff(win_t, COLOR_PAIR(COLOR_PATH));
|
||||
mvwaddstr(win_t, 0, strlen(global_path)+1, top_buffer+strlen(global_path)+1);
|
||||
wnoutrefresh(win_t);
|
||||
/*wnoutrefresh(win_t);*/
|
||||
wrefresh(win_t);
|
||||
pthread_mutex_unlock(&mutex_render);
|
||||
|
||||
|
||||
@@ -332,10 +337,20 @@ void *thread_btm(){
|
||||
unsigned int ui_btm_right_block_size = 0;
|
||||
unsigned int buffer_width = 0;
|
||||
|
||||
|
||||
while(!(status & STATUS_QUIT_PROGRAM)){
|
||||
pthread_mutex_lock(&mutex_btm);
|
||||
pthread_cond_wait(&cond_btm, &mutex_btm);
|
||||
|
||||
if (buffer_width != terminal_width) {
|
||||
buffer_width = terminal_width;
|
||||
if (terminal_width < 10) { buffer_width = 10; }
|
||||
|
||||
free(btm_buffer);
|
||||
btm_buffer = malloc(buffer_width+1);
|
||||
/*in this case STATUS_RUN_BACKEND should be true as defined in the main loop resize check*/
|
||||
}
|
||||
|
||||
|
||||
if (status & (STATUS_RUN_BACKEND | STATUS_RELOAD_DIRECTORY)) {
|
||||
/*{{{ parse storage info; the fold of shame*/
|
||||
@@ -408,15 +423,11 @@ void *thread_btm(){
|
||||
/*}}}*/
|
||||
}
|
||||
|
||||
if (buffer_width != terminal_width) {
|
||||
buffer_width = terminal_width;
|
||||
free(btm_buffer);
|
||||
btm_buffer = malloc(buffer_width+1);
|
||||
}
|
||||
memset(btm_buffer, ' ', buffer_width);
|
||||
btm_buffer[buffer_width] = '\0';
|
||||
|
||||
memcpy(btm_buffer + buffer_width - ui_btm_right_block_size, ui_btm_right_block, ui_btm_right_block_size);
|
||||
if (ui_btm_right_block_size + 9 < buffer_width) {
|
||||
memcpy(btm_buffer + buffer_width - ui_btm_right_block_size, ui_btm_right_block, ui_btm_right_block_size);
|
||||
}
|
||||
|
||||
if (mid_dir.current_file != NULL) {
|
||||
btm_buffer[0] = (S_ISLNK(mid_dir.current_file->permissions)) ? 'l':
|
||||
@@ -432,15 +443,17 @@ void *thread_btm(){
|
||||
btm_buffer[9] = (mid_dir.current_file->permissions & S_IXOTH) ? 'x' : '-';
|
||||
}
|
||||
|
||||
btm_buffer[buffer_width] = '\0';
|
||||
|
||||
|
||||
/* rendering */
|
||||
pthread_mutex_lock(&mutex_render);
|
||||
werase(win_b);
|
||||
if (*top_buffer != ' ') { /*printing ' ' (standard initialized value, see threading_init) makes valgrind throw a fuss*/
|
||||
mvwprintw(win_b, 0, 0, "%s", btm_buffer);
|
||||
}
|
||||
wnoutrefresh(win_b);
|
||||
|
||||
mvwprintw(win_b, 0, 0, "%s", btm_buffer);
|
||||
|
||||
/*wnoutrefresh(win_b);*/
|
||||
wrefresh(win_b);
|
||||
pthread_mutex_unlock(&mutex_render);
|
||||
pthread_mutex_unlock(&mutex_btm);
|
||||
/*the printing of all possible inputs are done in user_interactions */
|
||||
|
||||
Reference in New Issue
Block a user