aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui-day.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-05-28 20:55:06 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-05-28 17:58:06 -0400
commit0edc2e86378fdfe00255be3ac30c56eff359c961 (patch)
tree5e54e3b53f56e6d9f868ac793acd1b2d4913f581 /src/ui-day.c
parent7e0274bc08d483fa224540deae416f1e8c12dcbe (diff)
downloadcalcurse-0edc2e86378fdfe00255be3ac30c56eff359c961.tar.gz
calcurse-0edc2e86378fdfe00255be3ac30c56eff359c961.zip
Mark selected day in the appointments panel in multiple days mode
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-day.c')
-rw-r--r--src/ui-day.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ui-day.c b/src/ui-day.c
index 82db4e5..7774764 100644
--- a/src/ui-day.c
+++ b/src/ui-day.c
@@ -1112,7 +1112,7 @@ void ui_day_draw(int n, WINDOW *win, int y, int hilt, void *cb_data)
struct day_item *item = day_get_item(n);
/* The item order always indicates the date. */
time_t date = update_time_in_date(item->order, 0, 0);
- int width = lb_apt.sw.w - 2;
+ int width = lb_apt.sw.w - 2, is_slctd;
hilt = hilt && (wins_slctd() == APP);
if (item->type == EVNT || item->type == RECUR_EVNT) {
@@ -1121,18 +1121,19 @@ void ui_day_draw(int n, WINDOW *win, int y, int hilt, void *cb_data)
day_display_item_date(item, win, !hilt, date, y, 1);
day_display_item(item, win, !hilt, width - 1, y + 1, 1);
} else if (item->type == DAY_HEADING) {
+ is_slctd = conf.multiple_days && (date == get_slctd_day());
if (conf.header_line && n) {
wmove(win, y, 0);
whline(win, ACS_HLINE, width);
}
char *buf = fmt_day_heading(date);
utf8_chop(buf, width);
- custom_apply_attr(win, ATTR_HIGHEST);
+ custom_apply_attr(win, is_slctd ? ATTR_MIDDLE : ATTR_HIGHEST);
mvwprintw(win, y + (conf.header_line && n),
conf.heading_pos == RIGHT ? width - utf8_strwidth(buf) - 1 :
conf.heading_pos == LEFT ? 1 :
(width - utf8_strwidth(buf)) / 2, "%s", buf);
- custom_remove_attr(win, ATTR_HIGHEST);
+ custom_remove_attr(win, is_slctd ? ATTR_MIDDLE : ATTR_HIGHEST);
mem_free(buf);
}
}