diff options
| author | dam <dam@gudinoff> | 2022-09-28 16:40:48 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-09-28 16:40:48 +0000 |
| commit | a6f2aba9a42b4c439721668dd37f88f0e7c0b8fc (patch) | |
| tree | e585a7272ea307ba0fb37d67440d32b068861ed9 | |
| parent | 127e4e3fe6377ef5857b790e3f843f8449f1e9d9 (diff) | |
| download | task-time-tracker-a6f2aba9a42b4c439721668dd37f88f0e7c0b8fc.tar.zst task-time-tracker-a6f2aba9a42b4c439721668dd37f88f0e7c0b8fc.zip | |
Added theme colors to the daily total timers.
| -rw-r--r-- | main.c | 21 | ||||
| -rw-r--r-- | readme.md | 1 |
2 files changed, 18 insertions, 4 deletions
@@ -888,15 +888,28 @@ void draw_tui(database_t *db, layout_st *layout) { y = size_y-1; x = 0 + 1 + layout->columns[L_TITLE_IDX].width; total_time = 0; - for (int idx = 0; idx < WEEK_DAYS; idx++) { + for (int raw_idx = 0; raw_idx < WEEK_DAYS; raw_idx++) { + int idx = adjust_first_day_of_week[raw_idx]; + int64_t daily_total = db->total_times[idx]; x++; - int day_idx = (idx + FIRST_DAY_OF_WEEK) % WEEK_DAYS; - int64_t daily_total = db->total_times[day_idx]; - column_width = layout->columns[day_idx + L_DAYS_IDX].width; + + column_width = layout->columns[L_DAYS_IDX + idx].width; total_time = add_time(total_time, daily_total); format_time(string_buffer, daily_total, column_width); + + // Apply theme. + if (idx == now_week_day && active_task != NULL) { + attron(COLOR_PAIR(THEME_E) | A_BOLD); + } + else if(idx == now_week_day) { + attron(COLOR_PAIR(THEME_D) | A_BOLD); + } + mvaddstr(y, x, string_buffer); x += column_width; + + // Reset theme. + attrset(A_NORMAL); } x++; format_time(string_buffer, total_time, layout->columns[L_TOTAL_IDX].width); @@ -33,6 +33,7 @@ Task Time Tracker - [x] rename layout members: title_header, archive_header, total_header, days_headers, column_widths, column_alignments, headers_paddings. - [x] using the archive header, we can remove the top-left-corner diamond on the archive. - [x] Allow to cancel a rename_task operation: you can do it by leaving it blank. +- [ ] Make sure we are not using `strcat` and `strcpy`... or that we are using them wisely (famous last words). - [ ] Make archive be stored in CSV format: takes less space and allows to quickly archive by appending to end of file; - [ ] Implement `append_to_csv(task_t *task, char *path_name)` and use it in archive function; - [ ] MAYBE... IS THIS REALLY NEEDED? add helper func: get_selected_screen_row(db*, out int selected_row); It seems to be used in KEY_F(1) and KEY_F(2) cases of input management. |
