aboutsummaryrefslogtreecommitdiffstats
path: root/src/custom.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2017-09-05 09:29:17 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2017-09-08 21:08:53 +0200
commitd20f9a5d2e5b9903f7412cdec9e1bf28a94d02da (patch)
treee57836c1d8f3847baaa90538f758475950914709 /src/custom.c
parent172efd71798a00469658b0f0e6fc730bac6fa5fe (diff)
downloadcalcurse-d20f9a5d2e5b9903f7412cdec9e1bf28a94d02da.tar.gz
calcurse-d20f9a5d2e5b9903f7412cdec9e1bf28a94d02da.zip
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>
Diffstat (limited to 'src/custom.c')
-rw-r--r--src/custom.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/custom.c b/src/custom.c
index 1826156..4d02b4f 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -528,6 +528,7 @@ enum {
FIRST_DAY_OF_WEEK,
OUTPUT_DATE_FMT,
INPUT_DATE_FMT,
+ HEADING_POS,
DAY_HEADING_FMT,
NB_OPTIONS
};
@@ -549,9 +550,11 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
"general.firstdayofweek = ",
"format.outputdate = ",
"format.inputdate = ",
+ "appearance.headingposition = ",
"format.dayheading = "
};
const char *panel;
+ const char *position;
if (hilt)
custom_apply_attr(win, ATTR_HIGHEST);
@@ -653,6 +656,19 @@ 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 HEADING_POS:
+ if (conf.heading_pos == LEFT)
+ position = _("to the left");
+ else if (conf.heading_pos == CENTER)
+ position = _("in the middle");
+ else
+ position = _("to the right");
+ custom_apply_attr(win, ATTR_HIGHEST);
+ mvwaddstr(win, y, XPOS + strlen(opt[HEADING_POS]), position);
+ custom_remove_attr(win, ATTR_HIGHEST);
+ mvwaddstr(win, y + 1, XPOS,
+ _("(position of the heading in the appointments panel)"));
+ break;
case DAY_HEADING_FMT:
custom_apply_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y, XPOS + strlen(opt[DAY_HEADING_FMT]),
@@ -674,7 +690,7 @@ static enum listbox_row_type general_option_row_type(int i, void *cb_data)
static int general_option_height(int i, void *cb_data)
{
- if (i == 11)
+ if (i == INPUT_DATE_FMT)
return 4;
else
return 3;
@@ -704,6 +720,12 @@ static void general_option_edit(int i)
else
conf.default_panel++;
break;
+ case HEADING_POS:
+ if (conf.heading_pos == RIGHT)
+ conf.heading_pos = LEFT;
+ else
+ conf.heading_pos++;
+ break;
case AUTO_SAVE:
conf.auto_save = !conf.auto_save;
break;