From d20f9a5d2e5b9903f7412cdec9e1bf28a94d02da Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Tue, 5 Sep 2017 09:29:17 +0200 Subject: 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 Signed-off-by: Lukas Fleischer --- src/ui-day.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ui-day.c') diff --git a/src/ui-day.c b/src/ui-day.c index 6a06941..0be23af 100644 --- a/src/ui-day.c +++ b/src/ui-day.c @@ -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) { -- cgit v1.2.3-54-g00ecf