diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2017-08-19 10:23:52 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2017-08-28 07:30:38 +0200 |
commit | d56cc7acfe85119b70f7aac8dfd13ba41ec119e3 (patch) | |
tree | 69ea8c6e3e5d67d09bf129f3e50c3f54cb01ce58 /src/custom.c | |
parent | 550a2e937906d7e3c821d7508901eea2dafd9344 (diff) | |
download | calcurse-d56cc7acfe85119b70f7aac8dfd13ba41ec119e3.tar.gz calcurse-d56cc7acfe85119b70f7aac8dfd13ba41ec119e3.zip |
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 <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/custom.c')
-rw-r--r-- | src/custom.c | 20 |
1 files changed, 19 insertions, 1 deletions
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); |