diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 21 |
1 files changed, 17 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); |
