diff options
Diffstat (limited to 'ttt.jai')
| -rw-r--r-- | ttt.jai | 45 |
1 files changed, 19 insertions, 26 deletions
@@ -27,15 +27,6 @@ #import "Integer_Saturating_Arithmetic"; TUI :: #import "TUI"(COLOR_BIT_DEPTH=8); - -// TODO List: -// [ ] Every time we add or remove tasks to the database, it may be reallocated, thus making the selected_task and active_task pointers invalid. Check if this is messing up the app. -stdscr: *void; // TODO DAM -A_BOLD: s32 = 0; // TODO DAM -COLOR_PAIR :: (a: s32) -> s32 { return 0; } // TODO DAM -WINDOW :: struct { } // TODO DAM - - VERSION :: "2.0"; // Use only 3 chars (to fit layouts). YEAR :: "2024"; FIRST_DAY_OF_WEEK :: 1; // (0-6, Sunday = 0). @@ -123,35 +114,36 @@ Layouts :: enum u8 { COMPACT; } -error_window : *WINDOW = null; +// TODO NEXT Implement error window! + error_time_limit := Apollo_Time.{0, 0}; print_error :: (format :string, args : .. Any) { - if stdscr == null { // || isendwin() == true { // Not in ncurses mode? TODO DAM - print(format, ..args); - print("\n"); - } - else { - CHAR_SPACE :: #char " "; - w_size_x: int = ifx size_x > 120 then 120 else size_x - 2; - w_size_y: int = 4; - if (error_window == null) { + // if stdscr == null { // || isendwin() == true { // Not in ncurses mode? TODO DAM + // print(format, ..args); + // print("\n"); + // } + // else { + // CHAR_SPACE :: #char " "; + // w_size_x: int = ifx size_x > 120 then 120 else size_x - 2; + // w_size_y: int = 4; + // if (error_window == null) { //error_window = newwin(w_size_y, w_size_x, (size_y - w_size_y) / 2, (size_x - w_size_x) / 2); TODO DAM //wattron(error_window, COLOR_PAIR(xx Styles.ERROR)); TODO DAM //wborder(error_window, CHAR_SPACE, CHAR_SPACE, 0, 0, ACS_HLINE, ACS_HLINE, ACS_HLINE, ACS_HLINE); TODO DAM //mvwprintw(error_window, 0, 1, " Error "); TODO DAM //wmove(error_window, 1, 0); TODO DAM - } - else { + // } + // else { //waddch(error_window, CHAR_SPACE); TODO DAM - } + // } //wprintw(error_window, temp_c_string(tprint(format, args))); TODO DAM - error_time_limit = current_time_monotonic() + seconds_to_apollo(5); - } + // error_time_limit = current_time_monotonic() + seconds_to_apollo(5); + // } } draw_error_window :: () { - if (error_window == null) return; + // if (error_window == null) return; // Hide error window after time-limit or if terminal is shrank. w_size_x: s32; @@ -162,7 +154,7 @@ draw_error_window :: () { || size_y - w_size_y < 2 ) { //delwin(error_window); TODO DAM - error_window = null; + // error_window = null; return; } @@ -1673,6 +1665,7 @@ main :: () { //timeout(INPUT_AWAIT_INF); TODO DAM // TODO WIP Remove `selected_task` and `active_task` and helper functions. + // TODO Every time we add or remove tasks to the database, it may be reallocated, thus making the selected_task and active_task pointers invalid. Check if this is messing up the app. selected_task := get_selected_task(db); active_task := get_active_task(db); selected_task_row: int; |
