Make the day heading position configurable

The date at the top of the appointments list may be positioned either to
the left, in the middle or to the right. Default is to the right. Can be
configured from the general options menu.

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lars Henriksen
2017-09-05 09:29:17 +02:00
committed by Lukas Fleischer
parent 172efd7179
commit d20f9a5d2e
5 changed files with 62 additions and 2 deletions

View File

@@ -938,7 +938,10 @@ void ui_day_draw(int n, WINDOW *win, int y, int hilt, void *cb_data)
char *buf = fmt_day_heading(date);
utf8_chop(buf, width);
custom_apply_attr(win, ATTR_HIGHEST);
mvwprintw(win, y, width - utf8_strwidth(buf) - 1, "%s", buf);
mvwprintw(win, y,
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);
mem_free(buf);
} else if (item->type == DAY_SEPARATOR) {