Tweaks to file area chooser

This commit is contained in:
Andrew Pamment 2018-01-18 08:58:32 +10:00
parent 5690c91de2
commit 4c446797d8
3 changed files with 18 additions and 6 deletions

View File

@ -247,8 +247,8 @@ File exists!\r\n
\e[0;36mT. \e[1;37mToggle Auto-Signature (\e[1;33m%s\e[1;37m)\r\n
\e[1;37;44mChoose a Conference\e[K
\e[24;1H\e[1;37;44mUp / Down to Select, Enter to Confirm\e[K
\e[%d;1H\e[1;30;40m[\e[1;34;44m%.4d\e[1;30;40m] \e[1;37m%s\e[K
\e[%d;1H\e[1;30;40m[\e[1;34m%.4d\e[1;30;40m] \e[1;37m%s\e[K
\e[%d;1H\e[1;30;40m[\e[1;34;44m%4d\e[1;30;40m] \e[1;37m%s\e[K
\e[%d;1H\e[1;30;40m[\e[1;34m%4d\e[1;30;40m] \e[1;37m%s\e[K
\e[1;37;44mChoose an Area in %s\e[K
\e[1;37;44mChoose an Subdir in %s\e[K
\e[1;37;44mChoose a Directory\e[K

View File

@ -1382,6 +1382,7 @@ void choose_subdir() {
s_printf(get_string(250), i - start + 2, sub_tmp[i]->index, sub_tmp[i]->sub->name);
}
}
s_printf("\e[%d;5H", selected - start + 2);
redraw = 0;
}
c = s_getchar();
@ -1393,7 +1394,7 @@ void choose_subdir() {
c = s_getchar();
if (c == 66) {
// down
if (selected + 1 > start + 22) {
if (selected + 1 >= start + 22) {
start += 22;
if (start >= list_tmp) {
start = list_tmp - 22;
@ -1407,6 +1408,7 @@ void choose_subdir() {
if (!redraw) {
s_printf(get_string(250), selected - start + 1, sub_tmp[selected - 1]->index, sub_tmp[selected - 1]->sub->name);
s_printf(get_string(249), selected - start + 2, sub_tmp[selected]->index, sub_tmp[selected]->sub->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
} else if (c == 65) {
@ -1425,6 +1427,7 @@ void choose_subdir() {
if (!redraw) {
s_printf(get_string(249), selected - start + 2, sub_tmp[selected]->index, sub_tmp[selected]->sub->name);
s_printf(get_string(250), selected - start + 3, sub_tmp[selected + 1]->index, sub_tmp[selected + 1]->sub->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
}
@ -1482,6 +1485,7 @@ void choose_directory() {
s_printf(get_string(250), i - start + 2, dir_tmp[i]->index, dir_tmp[i]->dir->name);
}
}
s_printf("\e[%d;5H", selected - start + 2);
redraw = 0;
}
c = s_getchar();
@ -1493,7 +1497,7 @@ void choose_directory() {
c = s_getchar();
if (c == 66) {
// down
if (selected + 1 > start + 22) {
if (selected + 1 >= start + 22) {
start += 22;
if (start >= list_tmp) {
start = list_tmp - 22;
@ -1507,6 +1511,7 @@ void choose_directory() {
if (!redraw) {
s_printf(get_string(250), selected - start + 1, dir_tmp[selected - 1]->index, dir_tmp[selected - 1]->dir->name);
s_printf(get_string(249), selected - start + 2, dir_tmp[selected]->index, dir_tmp[selected]->dir->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
} else if (c == 65) {
@ -1525,6 +1530,7 @@ void choose_directory() {
if (!redraw) {
s_printf(get_string(249), selected - start + 2, dir_tmp[selected]->index, dir_tmp[selected]->dir->name);
s_printf(get_string(250), selected - start + 3, dir_tmp[selected + 1]->index, dir_tmp[selected + 1]->dir->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
}

View File

@ -2595,6 +2595,7 @@ void choose_conference() {
s_printf(get_string(250), i - start + 2, conf_tmp[i]->index, conf_tmp[i]->conference->name);
}
}
s_printf("\e[%d;5H", selected - start + 2);
redraw = 0;
}
c = s_getchar();
@ -2606,7 +2607,7 @@ void choose_conference() {
c = s_getchar();
if (c == 66) {
// down
if (selected + 1 > start + 22) {
if (selected + 1 >= start + 22) {
start += 22;
if (start >= list_tmp) {
start = list_tmp - 22;
@ -2620,6 +2621,7 @@ void choose_conference() {
if (!redraw) {
s_printf(get_string(250), selected - start + 1, conf_tmp[selected - 1]->index, conf_tmp[selected - 1]->conference->name);
s_printf(get_string(249), selected - start + 2, conf_tmp[selected]->index, conf_tmp[selected]->conference->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
} else if (c == 65) {
@ -2638,6 +2640,7 @@ void choose_conference() {
if (!redraw) {
s_printf(get_string(249), selected - start + 2, conf_tmp[selected]->index, conf_tmp[selected]->conference->name);
s_printf(get_string(250), selected - start + 3, conf_tmp[selected + 1]->index, conf_tmp[selected + 1]->conference->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
}
@ -2696,6 +2699,7 @@ void choose_area() {
s_printf(get_string(250), i - start + 2, area_tmp[i]->index, area_tmp[i]->area->name);
}
}
s_printf("\e[%d;5H", selected - start + 2);
redraw = 0;
}
c = s_getchar();
@ -2707,7 +2711,7 @@ void choose_area() {
c = s_getchar();
if (c == 66) {
// down
if (selected + 1 > start + 22) {
if (selected + 1 >= start + 22) {
start += 22;
if (start >= list_tmp) {
start = list_tmp - 22;
@ -2721,6 +2725,7 @@ void choose_area() {
if (!redraw) {
s_printf(get_string(250), selected - start + 1, area_tmp[selected - 1]->index, area_tmp[selected - 1]->area->name);
s_printf(get_string(249), selected - start + 2, area_tmp[selected]->index, area_tmp[selected]->area->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
} else if (c == 65) {
@ -2739,6 +2744,7 @@ void choose_area() {
if (!redraw) {
s_printf(get_string(249), selected - start + 2, area_tmp[selected]->index, area_tmp[selected]->area->name);
s_printf(get_string(250), selected - start + 3, area_tmp[selected + 1]->index, area_tmp[selected + 1]->area->name);
s_printf("\e[%d;5H", selected - start + 2);
}
}
}