From d56cc7acfe85119b70f7aac8dfd13ba41ec119e3 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Sat, 19 Aug 2017 10:23:52 +0200 Subject: Make heading in appointments panel configurable Add a new configuration variable format.dayheading to set the format of the date displayed at the top of the event and appointment list. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/custom.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/custom.c') diff --git a/src/custom.c b/src/custom.c index 20311b6..fd99e25 100644 --- a/src/custom.c +++ b/src/custom.c @@ -531,6 +531,7 @@ enum { FIRST_DAY_OF_WEEK, OUTPUT_DATE_FMT, INPUT_DATE_FMT, + DAY_HEADING_FMT, NB_OPTIONS }; @@ -550,7 +551,8 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d "general.progressbar = ", "general.firstdayofweek = ", "format.outputdate = ", - "format.inputdate = " + "format.inputdate = ", + "format.dayheading = " }; const char *panel; @@ -654,6 +656,14 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d datefmt_str[0], datefmt_str[1], datefmt_str[2], datefmt_str[3]); break; + case DAY_HEADING_FMT: + custom_apply_attr(win, ATTR_HIGHEST); + mvwaddstr(win, y, XPOS + strlen(opt[DAY_HEADING_FMT]), + conf.day_heading); + custom_remove_attr(win, ATTR_HIGHEST); + mvwaddstr(win, y + 1, XPOS, + _("(Format of the date displayed in the appointments panel)")); + break; } if (hilt) @@ -752,6 +762,14 @@ static void general_option_edit(int i) if (val != -1) conf.input_datefmt = val; break; + case DAY_HEADING_FMT: + status_mesg(output_datefmt_str, ""); + strcpy(buf, conf.day_heading); + if (updatestring(win[STA].p, &buf, 0, 1) == 0) { + strcpy(conf.day_heading, buf); + } + status_mesg(number_str, keys); + break; } mem_free(buf); -- cgit v1.2.3-54-g00ecf