aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/custom.c2
-rw-r--r--src/ui-day.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/custom.c b/src/custom.c
index d474d5b..01e6ba3 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -52,7 +52,7 @@ static struct attribute attr;
* Define window attributes (for both color and non-color terminals):
* ATTR_HIGHEST are for window titles
* ATTR_HIGH are for month and days names
- * ATTR_MIDDLE are for the selected day inside calendar panel
+ * ATTR_MIDDLE are for the selected day inside calendar and appointments panel
* ATTR_LOW are for days inside calendar panel which contains an event
* ATTR_LOWEST are for current day inside calendar panel
*/
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);
}
}