diff options
author | Andrés <andmarti@gmail.com> | 2021-03-19 08:55:12 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-03-19 08:55:12 -0300 |
commit | 63fc51043ed73707e812341858d8ce81d032370d (patch) | |
tree | b5883110db84f41b3b9501096f1726c39769d6ef /src/tui.c | |
parent | 62f3b6d1d9dc2a0cd9ad3b0e01521fa3c65fb232 (diff) |
Added BRAILLE macro to @npitre PR 515
Diffstat (limited to 'src/tui.c')
-rw-r--r-- | src/tui.c | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -104,8 +104,10 @@ WINDOW * input_win; SCREEN * sstderr; SCREEN * sstdout; +#ifdef BRAILLE int status_line_empty; int curwinrow, curwincol; +#endif /** * \brief Called to start UI @@ -121,7 +123,9 @@ void ui_start_screen() { main_win = newwin(LINES - RESROW, COLS, atoi(get_conf_value("input_bar_bottom")) ? 0 : RESROW, 0); input_win = newwin(RESROW, COLS, atoi(get_conf_value("input_bar_bottom")) ? LINES-RESROW : 0, 0); +#ifdef BRAILLE status_line_empty = 1; +#endif #ifdef USECOLORS if (has_colors()) { @@ -252,7 +256,9 @@ void ui_sc_msg(char * s, int type, ...) { mvwprintw(input_win, 1, 0, "%s", t); wclrtoeol(input_win); wmove(input_win, 1, 0); +#ifdef BRAILLE status_line_empty = 0; +#endif if (type == DEBUG_MSG || (loading && type == ERROR_MSG)) { wtimeout(input_win, -1); @@ -350,10 +356,12 @@ void ui_do_welcome() { } wrefresh(main_win); +#ifdef BRAILLE /* land cursor next to the help line */ curwinrow = LINES/2; curwincol = COLS/2-strlen(msg_help)/2-1; status_line_empty = 1; +#endif return; } @@ -388,7 +396,6 @@ void ui_update(int header) { // comment this to prevent info message to be erased //wmove(input_win, 0, 0); //wclrtobot(input_win); - //status_line_empty = 1; ui_show_celldetails(); // always before ui_print_mode ui_print_mode(); } @@ -432,9 +439,10 @@ void ui_update(int header) { // Show sc_row headings: 0, 1, 2, 3.. ui_show_sc_row_headings(main_win, mxrow); +#ifdef BRAILLE // Leave cursor on selected cell when no status message - if (status_line_empty) - wmove(main_win, curwinrow, curwincol); + if (status_line_empty) wmove(main_win, curwinrow, curwincol); +#endif // Refresh curses windows wrefresh(main_win); @@ -524,11 +532,13 @@ void ui_print_mult_pend() { wmove(input_win, row_orig, col_orig); wrefresh(input_win); +#ifdef BRAILLE if (status_line_empty && curmode != EDIT_MODE) { // Leave cursor on selected cell when no status message wmove(main_win, curwinrow, curwincol); wrefresh(main_win); } +#endif } /** @@ -583,7 +593,9 @@ void ui_clr_header(int i) { // Return cursor to previous position wmove(input_win, row_orig, col_orig); +#ifdef BRAILLE if (i == 1) status_line_empty = 1; +#endif return; } @@ -1038,10 +1050,12 @@ void ui_show_content(WINDOW * win, int mxrow, int mxcol) { wclrtoeol(win); } +#ifdef BRAILLE if (currow == row && curcol == col) { curwinrow = row + 1 - offscr_sc_rows - q_row_hidden; curwincol = c + ((align == 1) ? (fieldlen - 1) : 0); } +#endif // clean format #ifndef USECOLORS @@ -1292,7 +1306,9 @@ void ui_bail(lua_State *L, char * msg) { set_term(sstderr); move(0, 0); clrtobot(); +#ifdef BRAILLE status_line_empty = 1; +#endif clearok(stdscr, TRUE); mvprintw(0, 0, "%s", stderr_buffer); stderr_buffer[0]='\0'; @@ -1401,7 +1417,9 @@ char * ui_query(char * initial_msg) { wclrtoeol(input_win); wmove(input_win, 1,0); wclrtoeol(input_win); +#ifdef BRAILLE status_line_empty = 1; +#endif wrefresh(input_win); return hline; } |